For the Fashe Shopify theme, using the + or – quantity buttons on the individual product page had no effect on what was added to the cart. After trial and error on the product.liquid template and the common.js script, when I changed the quantity input type in the form in the product.liquid template from “number” to “text”, the exact quantities using the +/- buttons were reflected in the cart. However, Shopify itself states that that field should be “number” and not “text” https://help.shopify.com/en/themes/customization/products/features/add-quantity-selector
I’m thinking that the reason changing the field type from “number” to “text” works has something to do with the how the ajax string is processed in common.js? Potentially, the data has to be formatted as text and numerical data is ignored (that’s why the quantity was always the default of 1)? (there’s a line around line 110 that has “input[type=\’text\’] so potentially all other fields are being ignored in the JSON string? I dunno.
Anyway, I’m sure individuals will want the +/- quantity buttons to work in this Shopify theme. Just wanted to give a heads up.
Viewing 1 post (of 1 total)
The topic ‘Fashe individual product page +/- quantity’ is closed to new replies.
Disclosure: This page contains external affiliate links that may result in us receiving a commission if you choose to purchase mentioned product. The opinions on this page are our own and we don't receive additional bonus for positive reviews.
We change everything WordPress. One WordPress theme at a time.