How to enable separate subscription management for primary and secondary plans in Memberstack?

Post author
Hashem Selim

Hey yall - I see that a Member can have multiple subscriptions at the same time, but how do I configure Memberstack/Webflow to allow them to add/upgrade/downgrade a second subscription independent of the first subscription? See example below.

Example:

  • Primary Subscription with tiers: A, B, C
  • Secondary Subscription with tiers: 1, 2, 3

I have already configured the ability for customer to sign up for Primary subscription + upgrade/downgrade between tiers A, B, C. But how can I enable them to sign up for the Secondary subscription + upgrade/downgrade between tiers 1, 2, 3 (without affecting the primary subscription)?

Comments

1 comment

  • Comment author
    Raquel Lopez

    Hello,

    You can use a method already available in MemberstackDom library. You will attach an event listener to a button that will have your defined price ids.

    The code would look something like this

    document.querySelector(YOUR_BUTTON_SELECTOR).addEventListener("click", async () => {
        // Launch the Stripe customer portal
        const response = await memberstack.launchStripeCustomerPortal({
            // Optional parameters:
            priceIds: ["PRICE_ID_1", "PRICE_ID_2"], // insert the specific prices you want the user to switch
        });
        
    })
    

    If you need to tweak it more you can always ask help from ReyBot

    Here you can find the documentation of the launchStripeCustomerPortal method
    https://developers.memberstack.com/dom-package/playground#plan-management

    0

Please sign in to leave a comment.