Hi, I would like to remove/ disable the ‘Add to Cart’ button and quantity box for products that I have indicated as Sold Out. On the individual product pages the button has been disabled, but on the Collections page the button and quantity box is still clickable.
Link here: https://www.thegoodsmatrix.com/collections/all/manoa
(Product name: Breakfast Bar Hawaiian Coffee & Cacao Nibs 60g)
Currently using the Debut theme.
I’ve tried some of the solutions on here but doesn’t seem to work for me.
Any help would be appreciated!
Hi @TGM_SG ,
It looks like you have a custom code. Unfortunately, you have to have someone take a look in your code. I would suggest hiring a developer to do so
To remove or disable the “Add to Cart” button and quantity box for sold-out products on the Collections page in the Debut theme, you’ll need to make some modifications to the theme’s code. Follow these steps:
-
From your Shopify admin, go to Online Store > Themes.
-
Find the Debut theme and click on the “Actions” button, then select “Edit code” from the dropdown menu.
-
In the code editor, locate the collection-template.liquid file in the “Sections” or “Templates” folder.
-
Look for the code responsible for displaying the “Add to Cart” button and quantity box. It might look something like this:
- Wrap the above code with a conditional statement to check if the product is sold out. Add the following code before and after the existing code:
{% unless product.available %}
{% comment %}
Code for sold-out products
{% endcomment %}
{% else %}
{% endunless %}