How to remove a specific quick add to cart button

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

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.

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.

@Moeed Hi! I just sent you the information via private message.

I really appreciate your reply.

Hey @viaco

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. 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

@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