Solved

Quantity Selector (plus & minus) Will Not Change Quantity - Palo Alto

vavagraphics
Tourist
4 0 1

I am using the Palo Alto theme and the quantity selector plus and minus are not increasing or decreasing the quantity anymore. Not sure how to solve this issue. If anyone can help get it back on track it would be much appreciated.

 

https://actionflag.com/collections/american-flags/products/american-flag-endura-nylon-outdoor-flag-l...

Accepted Solution (1)
Rishihuptech
Shopify Partner
490 83 94

This is an accepted solution.

Hi @vavagraphics 
Add the below code to the theme.js file. This will resolve the issue with quantity selector.

const decreaseButton = document.querySelector('.quantity__btn--decrease');const increaseButton = document.querySelector('.quantity__btn--increase');const quantityInput = document.querySelector('.quantity__input');function decreaseQuantity() {let currentValue = parseInt(quantityInput.value, 10);const minValue = parseInt(quantityInput.min, 10);if (currentValue > minValue) {currentValue--;quantityInput.value = currentValue;}}function increaseQuantity() {let currentValue = parseInt(quantityInput.value, 10);currentValue++;quantityInput.value = currentValue; }decreaseButton.addEventListener('click', decreaseQuantity);increaseButton.addEventListener('click', increaseQuantity);

 

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required

View solution in original post

Replies 4 (4)

Rishihuptech
Shopify Partner
490 83 94

Hi @vavagraphics 
The URL you provided which show quantity dropdown not the plus minus selector & it working fine.
If you are working on the duplicate / preview theme then can you please share that URL. How to get a preview URL from duplicate theme Check screenshot
https://prnt.sc/wzcwNltiCffI Once you copy the link directly paste it here.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
Rishihuptech
Shopify Partner
490 83 94

This is an accepted solution.

Hi @vavagraphics 
Add the below code to the theme.js file. This will resolve the issue with quantity selector.

const decreaseButton = document.querySelector('.quantity__btn--decrease');const increaseButton = document.querySelector('.quantity__btn--increase');const quantityInput = document.querySelector('.quantity__input');function decreaseQuantity() {let currentValue = parseInt(quantityInput.value, 10);const minValue = parseInt(quantityInput.min, 10);if (currentValue > minValue) {currentValue--;quantityInput.value = currentValue;}}function increaseQuantity() {let currentValue = parseInt(quantityInput.value, 10);currentValue++;quantityInput.value = currentValue; }decreaseButton.addEventListener('click', decreaseQuantity);increaseButton.addEventListener('click', increaseQuantity);

 

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
vavagraphics
Tourist
4 0 1

@Rishihuptech Thank you for your help! This one has been bothering us!