Shopify - Remove 'buy it now' and 'add to cart' button from the theme template on some product pages

Viewed 707

Hello Shopify Developers.

I'm a newbie on Shopify. I want to edit the product theme template to be able to remove the buy it now and add to cart button from some products.

Would you give me a suggestion to do that? please teach me.

Best regards, Siva.

2 Answers

If I understood you well, you'd like to remove "Add to cart" button from some products? If that is the case, you could do this using some tags. Something like:

{% if product.tags contains 'your-tag' %}

   {% comment %} Something here {% endcomment %}
{% else %}
  {% comment %} Add to cart button {% endcomment %}
{% endif %}

add a tag called something like:

hide--add-to-cart

and find the add to cart button inside product.liquid and place it like:

{% unless product.tags contains 'hide--add-to-cart' %}
    place here your add to cart button
{% endif %}
Related