Auto-applying discount at checkout using customer tags.

Auto-applying discount at checkout using customer tags.

Natural1
Tourist
7 0 1

I followed the tutorial in this video https://youtu.be/id-U46Lljz0?si=KF-PZ_uG3N8JtG99 couple of months ago. I have just come back to find that my code no longer works.

I am using the dawn theme, and put this if statement in main-cart-items.liquid:

<form action="{{ routes.cart_url }}" class="cart__contents critical-hidden" method="post" id="cart">

      {% if customer.tags contains 'registered' %}
      <input type="hidden" id="discount" name="discount" value="registered">
      {% endif %}
      
      <div class="cart__items" id="main-cart-items" data-id="{{ section.id }}">
        <div class="js-contents">
          ...

This didn't work, even when I took it out of the if statement. No discount.

Have I got it in the wrong place? Any help would be appreciated.

 

This is my store, sorry I can only give a preview link right now, but I will try to update it every two days: https://youtu.be/id-U46Lljz0?si=KF-PZ_uG3N8JtG99 

 

Edit: I should mention that I am using the GoodApps Free Gifts plugin, I don't know if that will affect anything.

 

Thanks.

Replies 5 (5)

prakashVt
Shopify Partner
226 20 34

If you can share your store URL I can assist you better. 

- Free Customer Dashboard apps that enhanced your customers' experience - VTN Customer Dashboard
- Feel free to Contact for more help (Free Support): [email protected]
Natural1
Tourist
7 0 1

Sorry, I pasted the wrong link.

The store URL is here: https://www.goorganicshopping.com.au/

 

Any help would be greatly appreciated.

prakashVt
Shopify Partner
226 20 34

Hello @Natural1 
I created one account in your store using this email ID: [email protected]

But I think you may need to add the tag. 

 

 Please note that the code above will only work if the customer is logged in, has the required tag, and checks out using the form where you added the code.

- Free Customer Dashboard apps that enhanced your customers' experience - VTN Customer Dashboard
- Feel free to Contact for more help (Free Support): [email protected]
Natural1
Tourist
7 0 1

Hi @prakashVt 

I have given you the registered tag.

I was looking for another way to achieve the same result. because it wasn't really working before. It seems to be okay now, but if you know of any other ways I would be grateful if you could share them.

tobebuilds
Shopify Partner
447 32 120

Hi Natural1,

 

Instead of having to maintain your own code, especially if you are not a developer, I recommend trying our app, Regios Automatic Discounts. 

 

It's easy to set up an automatic discount for customers with a specific tag. For example, I have attached a screenshot of how to set up a 10% off discount for customers with the "registered" tag:

 

tobebuilds_0-1710658123929.png

 

No coding involved at all, and no manual maintenance required.

 

If you have any questions, just reply, and I'll be happy to answer.

 

Best,

Tobe

Founder, Regios Discounts app (4.9 stars, 54 reviews)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer