How do I disable 'Add to Cart' but only for selected products?

Some of my products are ‘in store exclusive’ so I need to be able to disable the ‘add to cart’ button on just some of my products. Does anyone know the best way to do this? Thanks

Hi Simon,

You could add a tag to the products “in-store-only”.

You could then use the Code Editor to wrap the Add To Cart button in a conditional statement.
For example:

{% unless product.tags contains "in-store-only" %}

{% endunless %}

You might also want to add some information for the visitors:

{% if product.tags contains "in-store-only %}

This product is only available in-store

{% endif %}

Thanks for this info. Where would I add this code?

It would depend on your theme. You might have a file called ‘product-form.liquid’ that contains the add to cart button. But that’s just a guess.

Obviously the actual code for the button element would need to be the same as your current theme code, not the simple example I posted above.

If you are not familiar with editing liquid code, or don’t feel comfortable, I would recommend hiring a developer to help you. You don’t want to make a mistake with the add to cart button and prevent customers from making purchases on your store.