Remove "Add to Cart" button on collection page for products with options

Hello!

I am having an issue with customers adding items with options to cart from the collection page. On the product page, these options are required for adding to cart, so I need to switch out the add to cart button on the collection page with a button that says “select options” that directs the customer to the product page to select options before adding to cart.

I added tags for “options” to the relevant products. Then I added this code to my collection.liquid:

{% if product.tags  contains ‘options’ %}
 
{% endif %}

But I’m getting a syntax error. Is anyone able to help identify the error?

Thank you!

Julia

@Julia_Kahlig-Ga

Please share store URL!

Thanks!

Your syntax is correct, the only thing I notice is that you have strange quotation marks. Did you perhaps copy this code from a text editing program? That could be the issue. Try copying and pasting this:

{% if product.tags contains 'options' %}
 
{% endif %}

Notice that if I paste your exact code here with the javascript syntax highlighter, options is actually not green and neither is your action in your form output, it’s because of the strange quotations. This’ll probably fix your issue.

{% if product.tags  contains ‘options’ %}
 
{% endif %}