How do I change the add to cart button on certain products or a certain collection?

I want to change it but I cant figure it out. any help is appreciated!

Hello @ChrisAkindayo ,

Wrap the add to cart button with id condition

e.g.

{% if product.handle == ‘you-product-handle’ %}

//change add to cart with specific text or necessary changes.

{% else %}

// Your existing code as it is.

{% end %}

Regards
Guleria

Hey @ChrisAkindayo ,

You can achieve this by leveraging product tags and applying conditional logic in your theme’s code.

For example, you can tag certain products with something like custom-button, and then in your product-card or main-product.liquid file, use an {% if %} condition to display a different “Add to Cart” button or text for those tagged products.

If you’re working with a specific collection, you can also check for collection.handle to target changes only within that collection.

Let me know your theme and what exactly you want the button to say/do — happy to help further.

Cheers!
Shubham | Untechnickle

1 Like