AndreasAnemyr Posted April 2, 2013 Share Posted April 2, 2013 (edited) I use 1.4.0.17 Problem: When the user clicks on upQuantity or the downQuantity the used value should be based on the minal Qty (you can set this value in general info or on the combinations if used... Example Min qty = 3pcs When you click Up, it counts up 3,6,9,12 ..... Not 3,4,5,6... order-opc.php Would be great if somene have a great solution for this ( maybe in the js cart_summary. Best regards! Andréas Edited April 4, 2013 by AndreasAnemyr (see edit history) Link to comment Share on other sites More sharing options...
AndreasAnemyr Posted April 3, 2013 Author Share Posted April 3, 2013 And solution is.... ( I use prestashop 1.4.0.17) yourtheme/shopping-cart-product-line.tpl: Change the inputfield to readonly="readonly". Customer would not be able to change it to custom value Put a new hidden field in yourtheme/shopping-cart-product-line.tpl <input id="min_{$product.id}_{$productAttributeId}" type="hidden" value"$product.minimal.quantity" With Jquery you can use this new hidden field to change the "default" qty. for eht functions downQuantity( ) & upQuantity( ) This is done in the cart-summary.js This is the simple code how it´s made... qty = $('#min_'+ productID+'_'+productAttributeId).val( ); Do you need more information. Reply here and i will explain more in details.... Link to comment Share on other sites More sharing options...
trangpl Posted April 8, 2013 Share Posted April 8, 2013 Hi I did the same as you said but the default quantity in the cart_summary.js still is 1. It cannot change to the quantity from the input in the shopping-cart-product-line.tpl ---- presta 1.5.4 --- Link to comment Share on other sites More sharing options...
martinjean Posted July 1, 2013 Share Posted July 1, 2013 for prestashop 1.5.4 add this line in yourtheme/shopping-cart-product-line.tpl <input id="min_{$product.id_product}_{$product.id_product_attribute}" type="hidden" value="{$product.minimal_quantity}"/> add this line in cart_summary.js var qty=$('#min_'+ productId+'_'+productAttributeId).val(); line 432 for upQuantity( ) line 513 for downQuantity( ) Link to comment Share on other sites More sharing options...
lvlehdi Posted November 27, 2018 Share Posted November 27, 2018 On 7/1/2013 at 7:53 PM, martinjean said: for prestashop 1.5.4 hi how can i do it for 1.6.1.8 i uploaded my cart-summary.js and shopping-cart-product-line.tpl please tell me simple,i'm new Best regards! cart-summary.js shopping-cart-product-line.tpl Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now