Hello,
I plan selling mostly unique (spare) parts, and items in small quantities, and without quantity discounts, nor priced options.
On the product page, how can one prevent setting a quantity higher than the inventory level being added to the cart?I would like to control the quantity enterd in the quantity field, as well as disable the "Add to cart" button if the quantity already in cart
plus the quantity mentioned are above the inventory level.
Exploring the source code with the browser development tools, the field is:
<input type="text" name="quantity" id="product_quantity" value="1" placeholder="" class="form-control short" size="3">
If the number of a given product in stock is 3, I would like to modify it to:
<input type="number" min="0" max="3" name="quantity" id="product_quantity" value="1" placeholder="" class="form-control short" size="3">
Doing a grep search,I could find the "product_quantity" string only in ".../templates/embed/js_product.tpl", but modifying the code there was without effect, even after clearing the cache.
So far,
I could not find where in the code the "product_quantity" field is generated ... Who can help?