Increasing quantity by Increments on Product Page

New Member
5 0 0

We want to increase quantity in increments of 2 on specific Product pages, but we don't want to make a variant or a drop down because we want the option to be limitless.  As had been suggested by the Shopify team we removed the if/then statement on the standard template page and minimized the new code to:

<label for="quantity" class="quantity-selector quantity-selector-{{ section.id }}">{{ 'products.product.quantity' | t }}</label>

<input type="number" id="quantity" name="quantity" value="2" min="2" step="2" class="quantity-selector">

We made a separate template called pair quantity and applied the above code to it and then added the pair quanity template to the required product. When you do this the quantity increases in increments of 2 and can be added to cart. The problem is once you hit the Checkout button the cart becomes empty. I believe it Has everything to do with the step=”2” because when I remove it, it works fantastic. Unfortunately we really want it to increase in increments.  Is there a code adjustment that needs to be made elsewhere?

You can test it out on this product to see exactly what happens: https://signsinthemaking.com/collections/better-homes-gardens/products/better-homes-gardens-directio...

0 Likes
Shopify Staff
Shopify Staff
309 24 45

Hi, Derek!

My name is Tira and I am a Shopify Guru ready to help.

I took a look at the example product link that you had provided. I did some testing and put a quantity of 2 into my cart and went to the checkout process and saw that the product still remained in the cart. It looks like it is working properly now. Has this been resolved?

After getting to the cart page, I did notice the quantity there is in increments of 1. If you would like, I can send a request to our design team to take a look and see if they could make a customization for you to increase the increments by 2. Please reply to this post to let me know if you would like me to send it up for you.

How is the rest of your store coming along?
 

Tira | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
New Member
5 0 0

Hi Tira, the Problem isn't whether it adds it to the Cart, the problem is when you hit checkout the entire cart disappears.  I am not sure if there is an error in the logic or if I need to add some liquid code somewhere else to account for this.

0 Likes
Shopify Staff
Shopify Staff
309 24 45

Tira here again!

 

Thanks for your reply, Derek!

 

I tried adding a quantity of 2 into my cart, and then hitting the checkout button again, and I do see that the quantity of product remained in my cart:

2019-01-29_16-31-03-51n3m

 

Could you confirm if you're seeing the same? 

 

I'm also curious to see if the community has any suggestions!

Tira | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
New Member
2 0 0

Hey Tira,

We're having a weird issue on our shop, whenever you increment an item quantity in the preview modal it gets incremented by 2 not just 1.

 

Do you have any suggestions on what might be the issue?

 

Thank you for your time.

0 Likes
Shopify Staff
Shopify Staff
309 24 45

Hi, @MK11.

 

Tira here, from Shopify Support. Thank you for reaching out with your question.

 

I would be happy to take a look at this for you. Could you reply to this thread with a link to the product that you're experiencing this on? Then I can take a further look and provide guidance.

 

I look forward to hearing from you! 

Tira | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
New Member
2 0 0

My dollysocks.myshopify.com is having the same problem on all products. Increases and Decreases by 2 on the checkout page

0 Likes
Highlighted
New Member
2 0 0

Hey Tira,

Thanks for the prompt reply.

 

Here's the shop url:

https://craftopia.shop/collections/all

 

If you visit the products page here and hover over any product and press the magnifying glass icon (preview), then try to increment the quantity  in the modal that pop ups it will increment by 2. I tried to debug the JS to see if the click handler is being called twice but I didn't reach anything.

 

Also, at initially the quantity is "01" and not just "1", which looks a bit weird as well.

 

Thank you for your support.

 

0 Likes
Shopify Staff
Shopify Staff
309 24 45

Hi, @AndreDias.

 

Tira here, from Shopify Support. Thanks for reaching out to us about this. 

 

I'm happy to take a look at your store, are you able to remove the storefront password from your store so that I may take a look? If you're uncomfortable with doing that, could you tell me what theme you're using? I can then provide you with guidance to help! 

 

I look forward to hearing from you.

Tira | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Shopify Staff
Shopify Staff
309 24 45

Hi again, @MK11!

 

Thank you for your store link. I went to your store and followed your instructions and I can see that the product quantity field does have the '01' and once the + and - buttons are pressed, the increments do decrease or increase by 2.

 

I noticed that the theme you are using is not one of our free Shopify themes. You'll need to reach out to the theme developer for your theme for support with this question, as they developed the theme and would have the knowledge to help. Support for third-party themes are outside our scope of support. To find the name of your developer for your theme, you can follow our guide here: Support for paid themes.

 

You can also look into hiring a design expert from our list of Shopify Experts to help. Shopify Experts specialize with coding customizations and can help with modifications on your theme. You can view the list, here: Hire a Shopify Expert.

 

Let me know if that helps and if you have any other questions!

Tira | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes