Helper for @member tier

@brooklet I recommend you check this thread… there was quite a bit of discussion around this stuff. Membership Tiers: beta feedback/issues

I’ve not looked at the documentation lately, but I know it was lagging when the membership stuff was fresh out of beta.

At the moment, I’m using something like this (written in Oct '21):

{{#if @member.paid}}
    {{#foreach @products as |product|}}
        {{#foreach @member.subscriptions as |sub|}}
            {{#match sub.price.product.product_id "=" product.id}}
                {{#match sub.status "!=" "canceled"}}
    var memberPlan = '{{product.name}}'.toLowerCase();
                    {{/match}}
            {{/match}}
        {{/foreach}}
    {{/foreach}}
{{else}}
    var memberPlan = "trainee";
{{/if}}

I’ve got the above in a partial inside a javascript block, which basically gives me a javascript variable with the member’s plan name that I can then use as a CSS class name wherever I need it.

Like I said, this was written back in October, so there may well be better ways to do it by now.

3 Likes