In Shopify I need to control whether certain products are able to display add to cart.
In the past I have tagged the product as "hide cart" and switched theme template to a version without the button.
How could I do this using the Porto theme?
Does it have a built in method of doing this or do I need to manipulate the theme partials / templates?
2
Answers
The simplest way that I can think of is to add a tag to all the products that you want to hide the add to cart button from, for example
hide-add-to-cart
.Then find the code that renders the button and wrap it in an
unless
statement:No, there is no way to do it, rather than modify the existing code or add a new template and assign the template to a particular product like your previous theme.
So basically there are 2 ways to achieve it:
as @Karim Tarek said you need to tag those products and then check the particular tag into snippets where the Add to cart formed and disable it or hide it.
you need to create a template where you simply copy the code from the default product template and comment the code is for Add to cart and choose this template for those products on which you don’t want to show the Add to cart button.
Code samples:
1.