MemberStack.io

Show current subscription details on member dashboard page

I’ve looked around in the help section and the MS admin area but cannot find the answer. I would like to display the current membership details on a member’s dashboard page, i.e. Membership name, cost and billing frequency.

So for example:

Your current membership is
Premium
€50/year

Would be great if you could let me know how to do that.

1 Like

Hello! You can do this with ms-hide attributes.

You’ll need to create an element on your site for each plan that contains the plan name and price. Then, using ms-hide attributes you can toggle which is visible depending on the members plan.

I can make a quick tutorial if that would be helpful :+1:

I understand what you mean. Can the data be put on the page dynamically? E.g. if the price or name of a membership type changes in MemberStack control panel, it’ll automatically show the new version on the website?

1 Like

That would be ideal, but not yet. It’s on the list of potential attributes. :crossed_fingers:

I imagine something like this will be easier once MemberStack doesn’t relies so much on cookies.

Duncan’s solution seems pretty simple, but you could also access and display the member’s membership information like this. This would get the membership details dynamically, but you would have to manually update the cost and frequency of the plans if you change those frequently.

MemberStack.onReady.then(function(member) {
   var membership = member.membership
   membership.id // current membership
   membership.status // active, canceled, past_due, unpaid, trialing
   membership.current_period_end // unix timestamp
   membership.cancel_at_period_end // true or false
    
   //If the membership plans won't be changing frequently, you can hard code the billing details based on the membership.id
   if( membership.id == theBasicPlanID){
      var membershipType = "Basic";
      var membershipCost = "$50";
      var membershipFreq = "monthly";
   } 
   if( membership.id == thePremiumPlanID){
      var membershipType = "Premium";
      var membershipCost = "$10,000";
      var membershipFreq = "annually";
   } 
   //Then display it on the profile page any way you'd like
})
3 Likes

Cheers – I’ll stick with the first suggestion with now.

1 Like

@Scott, you’re the best! :heart_eyes:

Thanks for taking the time to post things like this. We so appreciate it. Speaking of… check your DM’s later today. We’d like to find a way to say thank you.