Make the 'add to cart button' disappear if the price is 0

Hello,

How can I make the ‘add to cart button’ disappear if the price is 0? Is there a set formula? I am aware of where I need to input it.

Many thanks.

Kind regards,

Iulia

1 Like

Hi @iesilajoaca

In this situation, find the file where rendering the “add to cart” button, it can be “main-product.liquid, product-template. liquid, price.liquid, featured-product.liquid,…”

If in these files already defined variables “product” (can check if this variable is used, like: “product.id, product.title,…”), you can set a condition like this

In this condition, we can set all types of prices like maximum price, minimum price, and compare at price,… The block that rendering the “add to cart” button will be put in this condition (price != 0) so the “add to cart” block can’t render if the price of this product is 0.

I hope that you find my answer useful.

1 Like