Shopify themes, liquid, logos, and UX
Hi everyone,
I would like to remove the purchase button once a product is sold out. I made the settings in a a way that the products are added to the "sold out" collection once I have 0 stock.. in case it helps the coding part.
Hope someone can help:
https://woollenandkind.com/collections/sold-rugs/products/persian-6-6-x-3-4 (example product)
https://woollenandkind.com/collections/sold-rugs (collection)
Thank you in advance
Find the section of the template that displays the purchase button. This may vary depending on your theme, but it's often within a form block or something similar. You'll need to add Liquid code to check if the product is sold out and conditionally hide the purchase button.
{% if product.available %}
<!-- Display the purchase button when the product is available -->
<button type="submit" name="add" id="AddToCart" class="btn">Add to Cart</button>
{% endif %}
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