- June 11, 2019 at 12:19 am #224673
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.
You must be logged in to reply to this topic.