Show message in cart based on customer and product tags

Show message in cart based on customer and product tags

bdeaw
Shopify Partner
67 1 60

Hi, 

 

We sell memberships that give our customers discounts.  They get tagged when they purchase the membership. I'd like folks who are not tagged as a member to get a notification letting them know that they would save on the order if they purchase a membership.  

 

I assume the cart would be the best place for this. Is it possible?

 

I would also like to be able to have a notice show if certain items are put in the cart saying how much people would save if they buy the membership with a link to the membership so they can purchase it.  

 

Thx!

Replies 3 (3)

StoreWatchers
Trailblazer
205 30 39

Hello @bdeaw,

 

Greetings from the Store Watchers Support Team! Happy to help you today.
 
You can simply add the below code to your cart template file.

 

{% unless customer.tags contains 'yourmembershiptagname' %}
<h3>Purchase a membership to save more on your order.</h3>
{% endunless %}

 

Note: Make sure to update the condition with your exact tag name. 


Let me know if need further assistance
 
Regards,
Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs
bdeaw
Shopify Partner
67 1 60

Thank you!

 

I'm not super well-versed on editing the code. Could you tell me the best place to add this?  

StoreWatchers
Trailblazer
205 30 39

Hello @bdeaw,

 

Go to Online Store -> Edit code. Please check the below screenshot for your reference.

 

online-store.JPG

 

Then search for cart.liquid or cart-template.liquid depending on the theme that you used. Look for the <form> tag similar to the one below.

 

Capture.JPG

 

Add the code above the <form> tag.

 

Let me know if need further assistance

Regards,

Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs