I want to disable ‘Add to Cart’ and ‘Buy Now’ Buttons for my products on all pages of my storefront while I want to keep these buttons for same products on a different page.
Right now when I hide these buttons on one page, they get hidden across all pages of the website.
Background:
We are a bespoke Packaging Solutions business where we talk to the customer before confirming their custom order. We do not want to allow our customer the ability to add anything into the cart and checkout before getting in contact with us and discussing their requirements for which we will be providing a fully customised solution.
So we want two separate lists of the products where both lists have the same products, but one list is visible to the customer but without the option to ‘add to cart’ or self checkout, while the other list will have the option to add to cart and self checkout which we can allow the customer to get to separately after they have spoken to us and are ready to place their custom order.
Well, you can achieved this if you have a basic understanding of Liquid code.
In your Shopify admin, create two collections: one for products that you want to show without the “Add to Cart” and “Buy Now” buttons (let’s call this “NoCheckout”), and another for products that you want to sell with those buttons (let’s call this “CheckoutEnabled”).
2.Add the same products to both collections. This way, you’ll have the same products in both lists.
The most important and a bit tricky step
You’ll need to modify the liquid templates of your theme to conditionally hide the “Add to Cart” and “Buy Now” buttons based on the collection the product belongs to.
Here’s an example of how you can do this in your product template (product.liquid):
{% if product.collections contains ‘NoCheckout’ %}
.product-form {
display: none;
}
{% endif %}
Here is the logic, try this. Hope you will be able to resolve this without using any 3rd party app