customer subscription in liquid

avanor
New Member
2 0 0

Is there a way to see if a customer has an active subscription through liquid?

Something like 

{% if customer.active_subscription %}

etc.

 

Thanks,

0 Likes
Kyle_W
Shopify Expert
92 12 39

Hi @avanor!

The customer object in Liquid does not have an attribute for 'active subscription', but you can certainly use the customer object to do things like checking if the customer has an account or if they have opted-in for marketing: https://shopify.dev/docs/themes/liquid/reference/objects/customer

From my understanding you'd need to loop through a customer's orders and check to see if any of the orders contain selling plan line items: https://shopify.dev/tutorials/storefront-ux-guidelines-for-subscriptions#order-details. I personally do not have much experience with Shopify's new subscription feature, so maybe someone else can chime in with more details...

Hopefully this helps!

Kyle W | Helium Dev, LLC
Helium builds apps that merchants depend on:
- Customer Fields
- Meteor Mega Menu
0 Likes