Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
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.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025