Adding 3 products to cart at the same time with Shopify liquid
I'd like to create a button on Shopify product page which can add 3 products (quantity value =3) to the cart. I don't want to use shopify apps, but I am not sure if there's any way to add it using liquid code/js.
Inside your product template you should find the add to cart form. Inside the form, there is whether an hidden input whether a quantity select with name "quantity". If that's an hidden one, simply set its value to 3, if that's a visible quantity input or select, replace it by:
<input type="hidden" id="quantity" name="quantity" value="3">
To prevent issues, make a copy of your theme before updating it.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.