gjarrosson Posted March 2, 2014 Share Posted March 2, 2014 [english version below] Bonjour, Sur ma page de liste de produits, le boutton 'ajouter au panier' n'apparait que lorsque ma quantité minimale pour le produit est 1. Lorsque la quantité minimale est 6, le bouton 'ajouter au panier' n'apparait pas. Vous pouvez voir une exemple ici : http://www.levindefrance.com/41-achat-vin Auriez-vous une indication sur la façon de modifier cela ? Merci beaucoup d'avance, Gabriel Hi, On the product list page, the ‘add to cart’ button only appears when the quantity for the product is 1. When I have a minimum quantity of 6, the ‘add to cart’ button doesn’t appear. You can see an exemple here : http://www.levindefrance.com/41-achat-vin Would you have any indication on how I can change that ? Thanks a lot in advance, Gabriel Link to comment Share on other sites More sharing options...
CartExpert.net Posted March 3, 2014 Share Posted March 3, 2014 Hi. You need to modify the if statement in product_list.tpl and remove '&& $product.minimal_quantity <= 1' Then you need to find a way to pass the minimal quantity to the script that processes the cart addition. So you can create e.g. a hidden input field to store this value. Finally you will need to override ajax-cart.js and make the proper changes to the function that executes the ajax query, the 'add' function. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
gjarrosson Posted March 3, 2014 Author Share Posted March 3, 2014 Hi, Thanks a lot for you answer :-) Actually, I had found this '$product.minimal_quantity <= 1' and tried to remove it (actually I changed it to 18) and it didn't work because then the add to cart button said "you need a minimum of 6". So if this is the only solution, my question becomes : how to make it add 6 products by default when it's not one ? Can I use the variable $product.minimal_quantity ? Where ?Thanks a lot in advance, Regards, Gabriel Link to comment Share on other sites More sharing options...
CartExpert.net Posted March 4, 2014 Share Posted March 4, 2014 The easiest approach would be to add a hidden input and set its id to 'quantity_wanted_[PRODUCT_ID]' and set its value to $product.minimal_quantity. Then change the ajax-cart.js script and where the click is handled for every '.ajax_add_to_cart_button' change the parameters of the 'add' function to: ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val()); This should work. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
gjarrosson Posted March 5, 2014 Author Share Posted March 5, 2014 Hi, Thanks a lot for your help, I'm so grateful and I feel we're almost there ! Could you tell me where and how to add the 'hidden input' ? Would you happen to know the code snippet ?Thanks a lot again, Regards, GJ Link to comment Share on other sites More sharing options...
gjarrosson Posted March 17, 2014 Author Share Posted March 17, 2014 up ! :-) Link to comment Share on other sites More sharing options...
Guillaumeb59 Posted October 10, 2014 Share Posted October 10, 2014 Did someone have more details about the solution given ? Thanks ! 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