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?
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025