Website Building » Shopify » How Do I Hide Add to Cart Button on Shopify?

How Do I Hide Add to Cart Button on Shopify?

Last updated on October 2, 2022 @ 3:55 am

There are a few different ways that you can go about hiding the add to cart button on your Shopify store. One way is to use a bit of code in your theme.liquid file. Another way is to use a CSS file.

And finally, you can use a JavaScript file.

If you want to hide the add to cart button using code, you can do so by adding the following code to your theme.liquid file:

PRO TIP: If you are considering hiding the Add to Cart button on your Shopify store, be aware that this may have negative consequences for your business. Your store’s conversion rate may decrease if potential customers are unable to add items to their cart, and you may also see a decrease in overall traffic and sales. Proceed with caution if you decide to hide the Add to Cart button on your Shopify store.


{% if template == 'product' %}
{% if product.available == false %}

{% endif %}
{% endif %}

This code will only hide the add to cart button on product pages where the product is unavailable. If you want to hide the add to cart button on all pages, you can use the following code:


{% if template != 'cart' %}

{% endif %}

Conclusion: There are a few different ways that you can go about hiding the add to cart button on your Shopify store.

Another way is to use a CSS file. And finally, you can use a JavaScript file.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.