Quick Add To Cart button on Collection page in Shopify.

You can add an Add to Cart button for each item on a collection page. Add to Cart button on the collection page keeps your shoppers from being redirected to the product page or shopping cart. This will allow your clients to easily and effortlessly add products to the cart without opening the product page.Quick Add To Cart button on Collection page in Shopify.

Please follow the below steps to add the “Add to cart” button on the Shopify collection pages for each product.

1. From your Shopify admin to Online Store > Theme.

2. Find the theme you want to edit and then click Action > Edit code.

3. On the collection page, find the loop {% for product in collection.products %} and add the below code.

<form action="/cart/add" method="post">
{% if product.variants.size == 1 %}
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
{% else %}
<select name="id">{% for variant in product.variants %}<option value="{{ variant.id }}">{{ variant.title }}</option>{% endfor %}</select>
{% endif %}
<div><button type="submit" name="add">Add to cart</button></div>  
</form>

4. Click Save.Quick Add To Cart button on Collection page in Shopify.

5. Go to your store, then open the collection page and check.

If you need any help please leave your queries in the comment box.