Auto-applying discount at checkout using customer tags

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.

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

Sorry, I pasted the wrong link.

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

Any help would be greatly appreciated.

Hello @Natural1
I created one account in your store using this email ID: prakash.prabhakar@yopmail.com

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.

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.

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:

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