Add ti cart button

NonaSupperClub
Tourist
6 0 2

Hello there,

Im using Brooklyn template for my page and want to have an add to cart button in my collection list on the home page.

Help Please

thanks!

g33kgirl
Shopify Partner
211 51 64

Hi @NonaSupperClub, you can follow this instruction here: https://community.shopify.com/c/Shopify-Design/How-to-add-quot-add-to-cart-quot-button-on-my-collect...

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl ☕
If you're not comfortable with code, please modify code files at your own risk.
Do NOT give out your passwords unless absolutely necessary.
0 Likes
dmwwebartisan
Shopify Partner
5731 1308 1682

@NonaSupperClub 

This code should be inserted in the middle of the product-grid-item.liquid Snippet file. We inserted it at line 82, before this code:

 

<a href="{{ product.url | within: collection }}" class="grid-product__meta">

Inserted code:

{% comment %}
    Next bit of code has been added to include "Add to Cart" button below every product in a grid, with the quantity 
    displayed
{% endcomment %}
    
	<form method="post" action="/cart/add">
		<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
      	<br />
 		<center><input min="1" type="number" id="quantity" name="quantity" value="1"/></center>
		<input type="submit" value="Add to cart" class="btn" />
	</form>

Hope this works.
Thanks!

 

If helpful then please Like and Accept Solution.
Email: dmw.webartisan@gmail.com | Instagram: @dmw.webartisan
Advanced Shopify Page Builder to customize your pages - check here PageFly App
0 Likes