How to include a button "Add to Cart" in a list of items?

New Member
4 0 0

In my shop, items are presented in a list with a picture and a short description. Customers can click the item, then visit a page with a more extensive description. From there, they can add the item to their shopping cart. It works, but some clients already know what they want and they should be able to order directly from the list. It would be much easier for them. 
Is there an app for this? 

0 Likes
Shopify Partner
14 1 3

Hi @Mika5 

 

 

In your product-grid-item.liquid file, find the div with class product-item--price and add this before the closing div.

 <form method="post" action="/cart/add">
  <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
 
  <input type="submit" value="Add to cart" class="btn" />
      <input type="hidden" name="return_to" value="back" />
</form> 

1 Like