viaco
August 8, 2023, 7:29pm
1
Hello,
I added this code in order to add an add to cart button below each product on the collection page:
<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input type="submit" value="{% if product.variants.first.available%}AddToCart{% else %}SoldOut{% endif%}" class="btn" {% unless product.variants.first.available %}disabled{% endunless %} />
</form>
And I would like to remove it from one of the products on the collection. Or changing its redirection and lable at least.
Anyone knows how can i get this?
I would really appreciate some kind of help.
Thank you
Moeed
August 9, 2023, 4:56am
2
Hey @viaco
Kindly share the link of the collection from where you want to remove the Add to Cart button and please mention on which product you’d like to remove that button from.
viaco
August 9, 2023, 9:11am
3
Hi, I know how to remove it from the whole collection, but not from just one product on that collection product list. This is the problem.
viaco
August 9, 2023, 9:19am
4
@Moeed Hi! I just sent you the information via private message.
I really appreciate your reply.
Moeed
August 10, 2023, 6:44pm
5
Hey @viaco
Follow these Steps:
Go to Online Store
Edit Code
Find theme.liquid file
Add the following code in the bottom of the file above tag
{% for c in product.collections %}
{% if c.handle == "i-piu-venduti" %}
{% endif %}
{% endfor %}
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
viaco
August 10, 2023, 11:41pm
6
@Moeed I just tested and the code is not making any change in the button appearance because it is showing below the product where i want it to be hidden