Summary - Would like code to help with:
Hi Shopify Design Forum!
Designing our first ever site with Shopify. Been very self-explanatory to pick up so far even with simple questions just looked up on the forums; however, I can't find code that works to do this. I would like to add Add to Cart buttons to all products on collection pages so that customers don't have to click into products to order them.
Much of what we sell does not require reading about the product and in today's fast-paced world, I believe many people (particularly those on the go) would find it cumbersome to click into each individual item to add them.
Also, since some of our items are bought in larger-than-one quantities, can I also add a Quantity Selector for each item beside the Add to Cart button?
Thanks for your help, Shopify Design forum.
Hey William!
Glad to see you using Shopify, it's a great platform! That's a great idea, and I'd be happy to help you achieve that! :)
<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input min="1" type="number" id="quantity" name="quantity" value="1"/>
<input type="submit" value="Add to cart" class="btn" />
</form>
Best of luck with your store and I hope I was able to help! All the best William :D
Hi Brydon,
Appreciate this. I was able to get it to work and played around to figure out the middle line was for the quantity selector. Not sure if I want that or not yet.
For Debut theme, for us, it was under product-card-grid.liquid under Snippets for reference to any out there that it may help pinpoint (at least until it is outdated). :)
Thanks again, definitely appreciate the wisdom.
If you want the button to redirect the user to the product page, then you should just add an url to the product page ;)
But for the add to cart button, I know that a lot of stores use an app for it. It is called Add to cart button and it adds an add to cart button to your products on collection pages. This button works in a way that you can add each item to the cart without being redirected to the product or cart. It is really amazing.
Subject | Author | Posted |
---|---|---|
2m ago | ||
26m ago | ||
33m ago | ||
39m ago | ||
42m ago |