All things Shopify and commerce
Hello,
In the store, I have linked the CRM on line app which connects the Line App of customer. Now I want the customers to be able to place the order only if they have been connected to Line. Basically when they connect to Line, a customer tag is automatically added to the customer. My question is, is there any way where we can disable the Add to Cart/Buy button based on customer tags? Same as, the add to cart should be enabled only to customers with a specified tag. If there is any method to do the same, please let me know.
Thanks in advance.
Solved! Go to the solution
This is an accepted solution.
Hi @megharose , do you want to disable button or hide it?
If you want to hide it, here is an example:
{% if customer.tags contains "someTAG" %}
//Code for buttons
{% else %}
//Something else
{% endif %}
if this doesn't work, try looping:
{% for tag in customer.tags %}
{% if tag == "someTAG" %}
//code for buttons
{% else %}
//something else
{% endif %}
{% endfor %}
if you find my answers helpful, please mark resolved or like.
This is an accepted solution.
Hi @megharose , do you want to disable button or hide it?
If you want to hide it, here is an example:
{% if customer.tags contains "someTAG" %}
//Code for buttons
{% else %}
//Something else
{% endif %}
if this doesn't work, try looping:
{% for tag in customer.tags %}
{% if tag == "someTAG" %}
//code for buttons
{% else %}
//something else
{% endif %}
{% endfor %}
if you find my answers helpful, please mark resolved or like.
Thanks!
In what area of "edit code" do we place this?
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025