All Collections
For everyone else
Other integrations
Using Liquid to enhance the member experience
Using Liquid to enhance the member experience

Example of how to use the membership tag in Shopify Liquid to create a great member experience

Kunal Gupta avatar
Written by Kunal Gupta
Updated over a week ago

Here are the rules for we apply membership tags: article

You can use membership tags to enhance the member experience on Shopify.

For example, members can always access their Shopify discounts by visiting withfriends.co. But you can include it on your account page as well.

Here's an example of using tags to help customers access their member discounts from within their Shopify dashboard, even if they don't visit Withfriends.

In Shopify, navigate to Themes > Customize > Edit Code > customers/account.liquid

Right at the top, under myaccount, add the following code

{% for customer_tag in customer.tags %}
{% if customer_tag contains 'Withfriends'%}
<div class="grid__item">
<h2>My Membership</h2>
<p>
Thank you for being a member! Use this link below, and you will automatically receive
{% if customer_tag contains 'Vinyl Fan'%}10%{% endif %}
{% if customer_tag contains 'Liner Notes Friend'%}25%{% endif %}
{% if customer_tag contains 'Deep Cuts Family'%}50%{% endif %}
off your order at checkout. :)
</p>
<a
{% if customer_tag contains 'Vinyl Fan'%}href="https://hypnotic-records.myshopify.com/discount/VINYLFAN-4508511"{% endif %}
{% if customer_tag contains 'Liner Notes Friend'%}href="https://hypnotic-records.myshopify.com/discount/LINERNOTESFRIEND-4508513"{% endif %}
{% if customer_tag contains 'Deep Cuts Family'%}href="https://hypnotic-records.myshopify.com/discount/DEEPCUTS-4508515"{% endif %}
class="btn btn--medium"
>
My Member Discount
</a>
<br/>
<br/>
</div>
{% endif %}
{% endfor %}

*Note: You need to swap out your membership data for the ones in the example above. Grab the discount codes by visiting the discounts area of your Shopify app.

Now, when your members log into their account, they'll see a member discount button appropriate to their specific membership.

The member discount button automatically applies their discount on their next purchase. It's equivalent to the "Get a shareable link" button in the Shopify discounts admin panel.

That's it! You've made memberships easier for your member using our membership tag integration for Shopify.

Add a Manage My Membership button to your account page

{% for customer_tag in customer.tags %}
{% if customer_tag contains 'Withfriends'%}
<div class="grid__item">
<h2>My Membership</h2>
<a href="https://withfriends.co/dashboard/memberships:email_address={{ customer.email}}">
Manage My Membership
</a>
</div>
{% endif %}
{% endfor %}

Other ideas

You can also use member tags to replace prices with member prices, add a thank you for members during checkout, and more!

Did this answer your question?