istox Posted October 19, 2014 Share Posted October 19, 2014 (edited) Hi Is there any way in prestashop 1.6 limit quantity of products in cart? For example: Cart can contain maximum products = 20? Or cart can contain maximum order amount 1000EUR? Edited October 19, 2014 by istox (see edit history) Link to comment Share on other sites More sharing options...
thepan Posted October 19, 2014 Share Posted October 19, 2014 This gentleman developed a module that should suit your needs: LINK Please read the whole thread Link to comment Share on other sites More sharing options...
istox Posted October 19, 2014 Author Share Posted October 19, 2014 Thanks for your help, but not helped me. I need no ORDER quantity. I need that users can't ADD products in cart more than 20 or not more than amount of currency. I need it to stop some users and bots to ADD products to cart for more than 10 or 20 pcs. Link to comment Share on other sites More sharing options...
thepan Posted October 19, 2014 Share Posted October 19, 2014 (edited) You want to limit the total amount of all products that can be added to the cart? Lets say 20 Maximum: 5 x Product a 8 x Product b 7 x Product c or just 20 x Product a or 10 x a and 10 x b right? Same is possible for total amount. Then look into the Link I gave you. Im pretty sure the module can do this. Its not mentioned in the first post but later on. Also if you want to stop robots from creating carts there is a better solution. LINK Edited October 19, 2014 by thepan (see edit history) Link to comment Share on other sites More sharing options...
istox Posted October 19, 2014 Author Share Posted October 19, 2014 I read all thread. There are things for finish order limit. But I need from begin Just add any of products maximal 20pcs. Product A = 4 Product B = 10 Product C= 6 Link to comment Share on other sites More sharing options...
thepan Posted October 19, 2014 Share Posted October 19, 2014 (edited) I see. Once the cart reaches a certain amount of products (lets say 20) you want to give out an error message saying "no more then 20 products can be added to your cart"? Maybe one of these here then LINK LINK2 Edited October 19, 2014 by thepan (see edit history) Link to comment Share on other sites More sharing options...
istox Posted October 19, 2014 Author Share Posted October 19, 2014 Yes, this is right! Sorry for my English. Message is no need. Link to comment Share on other sites More sharing options...
istox Posted October 19, 2014 Author Share Posted October 19, 2014 Link 2 is close to my needs, but it is for prestashop 1.4. The code in 1.6 is different. Link to comment Share on other sites More sharing options...
thepan Posted October 19, 2014 Share Posted October 19, 2014 (edited) Okay so I just tried it myself this solution LINK post #7 works with 1.6.0.9. A costumer only can add a maximum of 20 items into the cart. You need to change the number here if ($this->context->cart->nbProducts() > 0) should be if ($this->context->cart->nbProducts() > 19) and change this message to what you would like to have there $this->errors[] = Tools::displayError('Only twenty products per order are allowed. Please continue to checkout'); } Edited October 19, 2014 by thepan (see edit history) 1 Link to comment Share on other sites More sharing options...
istox Posted October 19, 2014 Author Share Posted October 19, 2014 Thanks! Helped and Solved! Link to comment Share on other sites More sharing options...
Ebersol Posted January 4, 2019 Share Posted January 4, 2019 I use Prestashop 1.6.0.6 Where should I make this change? Which way, please. Link to comment Share on other sites More sharing options...
Ebersol Posted January 4, 2019 Share Posted January 4, 2019 (edited) Thanks for the quick reply but where? In /controllers/front/OrderController.php ? Ebersol I use Prestashop 1.6.0.6 Where should I make this change? Which way, please. Edited January 4, 2019 by casadabalsa - (see edit history) Link to comment Share on other sites More sharing options...
Ebersol Posted November 10, 2020 Share Posted November 10, 2020 Prestashop 1.7.6.8 version How to limit the total number of products in the cart? EX 6 products A + 4 products B. total = 10 and cannot add another product, as it has reached the specified limit of 10 products at most. 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