New features available! Check the changelog
Subscribfy

Redirect Membership Product

Automatically redirect visitors from the membership product page to your custom landing page.

Redirect customers who land on your membership product page to a dedicated landing page like /pages/rewards or /pages/vip. This provides a better experience than showing a standard product page.


Why Use This

  • Better conversion: Landing pages convert better than product pages for memberships
  • More information: Landing pages can showcase all membership benefits in detail
  • Professional look: Avoid showing membership as a "product" with quantity selectors
  • SEO flexibility: Keep your membership SEO on a custom page

Implementation

Create Your Landing Page

First, create a dedicated landing page in Shopify:

  1. Go to Online Store > Pages in Shopify admin
  2. Create a new page (e.g., "Rewards" or "VIP Membership")
  3. Design it to showcase your membership benefits
  4. Note the page URL (e.g., /pages/rewards)

Add the Redirect Code

Add this code to your theme. The best location is in snippets/product-form.liquid or wherever your product form is rendered, at the very top of the file:

{% assign current_variant_id = product.selected_or_first_available_variant.id %}
{% assign membership_variant_id = shop.metafields.exison.exison_plan_settings.product_variant_id.value | default: shop.metafields.exison.exison_plan_settings.product_variant_id %}

{% if current_variant_id == membership_variant_id %}
  <script>
    window.location.href = '/pages/rewards';
  </script>
{% endif %}

Change /pages/rewards to match your actual landing page URL.

Test the Redirect

  1. Visit your membership product page directly
  2. You should be immediately redirected to your landing page
  3. Verify the landing page loads correctly
  4. Verify the redirect doesn't happen for other products

How It Works

The code compares the current product variant ID with the membership variant ID stored in Subscribfy's metafields. If they match, it means the visitor is on the membership product page, and they get redirected to your landing page.

MetafieldDescription
shop.metafields.exison.exison_plan_settings.product_variant_idThe Shopify variant ID of your membership product

Alternative Placements

You can add this code in different locations depending on your theme:

LocationWhen to Use
snippets/product-form.liquidMost themes - redirects before form renders
sections/main-product.liquidIf your theme uses sections for product pages
templates/product.liquidLegacy themes without sections

Place the code at the very top of the file, before any HTML output. This ensures the redirect happens immediately.


Troubleshooting

Redirect not working

  1. Verify the membership plan is configured and enabled in Subscribfy
  2. Place debug code before the if statement to check the variant IDs:
{{ current_variant_id }}
{{ membership_variant_id }}

Then refresh the page to see if the current_variant_id and membership_variant_id are the same. If they don't match, the redirect won't trigger.

Redirect loop

If you experience a redirect loop, make sure your landing page does not include the same product form snippet that contains the redirect code.

Want to keep the product page accessible

If you need the product page accessible for some users (e.g., for direct checkout links), you can add a URL parameter bypass:

{% unless request.path contains 'direct=true' %}
  {% assign current_variant_id = product.selected_or_first_available_variant.id %}
  {% assign membership_variant_id = shop.metafields.exison.exison_plan_settings.product_variant_id.value | default: shop.metafields.exison.exison_plan_settings.product_variant_id %}

  {% if current_variant_id == membership_variant_id %}
    <script>
      window.location.href = '/pages/rewards';
    </script>
  {% endif %}
{% endunless %}

Then access the product page directly via /products/membership?direct=true.

Was this page helpful?

On this page

AI Chat

Ask a question about Subscribfy