Quantity Increasing by 2 rather than 1

Highlighted

Hello, 

 

I found a similar post but the solution did not work for me. I'm hoping someone wouldn't mind sparing a few minutes to check out the website. On a product page, the quantity button adds 2 instead of just 1. It starts at 1, and pressing the increase button sends it to 3. If you manually enter 4 and press decrease, the quantity drops to 2. 

 

We have QuickView enabled, which also shows the quantity buttons, but the quantity works correctly when using QuickView. I couldn't find anything related to the button values in the QuickView snippet, but perhaps it is somewhere else and is communicating twice on the product page. 

 

A URL for one product is: https://imperialtropicals.com/collections/australian-rainbows/products/deep-water-creek-m-splendida-...

 

Here is the coding for the quantity button that I could find: 

 

{% if product.available %}
<label for="quantity" {% if settings.enable_multilang %}data-translate="cart.label.quantity"{%endif%}>{{ 'cart.label.quantity' | t }}: </label>

<input type="text" id="quantity" name="quantity" value="1">
<div class="extra">
<div class="inc button">+</div>
<div class="dec button">-</div>
</div>
<script>
jQuery(".button").on("click", function() {
var oldValue = jQuery("#quantity").val(),
newVal = 1;

if (jQuery(this).text() == "+") {
newVal = parseInt(oldValue) + 1;
} else if (oldValue > 1) {
newVal = parseInt(oldValue) - 1;
}

jQuery("#quantity").val(newVal);
{% if settings.display_subtotal and product.available %}
updatePricing();
{% endif %}

 

 

If anything else is needed, please let me know. 

0 Likes
Highlighted
Shopify Partner
1022 212 256

Hello,

Remove this code

<script>
jQuery(".button").on("click", function() {
var oldValue = jQuery("#quantity").val(),
newVal = 1;

if (jQuery(this).text() == "+") {
newVal = parseInt(oldValue) + 1;
} else if (oldValue > 1) {
newVal = parseInt(oldValue) - 1;
}

jQuery("#quantity").val(newVal);
{% if settings.display_subtotal and product.available %}
updatePricing();
{% endif %}
});
            </script>
Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted

Hi Guleria, 

 

Thanks for the recommendation. I feared it would render the entire quantity bar useless, and unfortunately it has. Clicking increase or decrease no longer adjusts the quantity on the product page. However, the QuickView quantity bar still functions as normal, which indicates that perhaps there is some similar code somewhere? 

0 Likes
Highlighted
Shopify Partner
1022 212 256

hmm but if you check console you will find there is another JS conflict  which prevent it when you remove it.
You have to first manually fix this conflict or If you want you can drop me and email and we"ll discuss further.
Thanks

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes