misja Posted April 15, 2013 Share Posted April 15, 2013 Hi, does anyone know if it is possible to specify that the customer can order a maximum of one product at a time.I do believe that there is an option to set a maximum quantity of products per customer, but that's not the intention. the customer may order as many as he wants, But he has to go true the orders street for each product he ordered. the reason why I want this is, is that I don't sell products but I give them away for free, I only charge shipment costs and if people can order more than 1 product it cost me money.I hope someone can help me a bit to solve this for me.Sorry for my english I hope you understand my question. SOLVED! i decided to use vekias module maximum product quantity Link to comment Share on other sites More sharing options...
PascalVG Posted April 16, 2013 Share Posted April 16, 2013 Do you 'sell' more products, or really only one? If more, can the customer order 1 OF EACH max per checkout, or maximum of 1 product, regardless of which one? I.e if you have product A,B,C,D,... can the customer order say: Product A 1x max AND Product C 1x max AND Product D 1x max or can he only say Product C 1 x max and nothing else? What version of Prestashop do you use? Pascal Link to comment Share on other sites More sharing options...
GoGoMo Posted April 16, 2013 Share Posted April 16, 2013 Hi, does anyone know if it is possible to specify that the customer can order a maximum of one product at a time. I do believe that there is an option to set a maximum quantity of products per customer, but that's not the intention. the customer may order as many as he wants, But he has to go true the orders street for each product he ordered. the reason why I want this is, is that I don't sell products but I give them away for free, I only charge shipment costs and if people can order more than 1 product it cost me money. I hope someone can help me a bit to solve this for me. Sorry for my english I hope you understand my question. Have you checked the http://addons.prestashop.com for a minimum/maximum quantity module yet? I believe you can restrict how many items a customer can purchase based on your specific maximum quantity requirement. I think you should make the customer pay for any additional item they may wish to order from your online Prestashop so as you said, "you don't have to eat the additional shipping fees" of paying for shipping for each additional item they purchase from your online shop if that makes any sense. You may want to restrict the maximum weight that the customer can ship to their delivery address since the item's weight influences the freight cost to ship to customer's address depending upon which courier service you're going to use for shipping. Link to comment Share on other sites More sharing options...
misja Posted April 16, 2013 Author Share Posted April 16, 2013 (edited) @pascal I offer more than 1 item, but the customer can only get 1 item each time. If the customers want more products they have to come back and order the product again. just like this: Product C 1 x max and nothing else The raison why I want it this way is because I offer the products for free and only charge some shipping fee. when people can take more than 1 product I can't charge the shipping fee for each product. I use PrestaShop™ 1.5.3.1 Edited April 16, 2013 by misja (see edit history) Link to comment Share on other sites More sharing options...
misja Posted April 16, 2013 Author Share Posted April 16, 2013 @gogomo I checked some modules but can find what I need, I don't want to restrict customers to buy or restrict the weight I only want that any customer only can make 1 order for 1 product each time, but they can order this product as much they want. Link to comment Share on other sites More sharing options...
Med6 Posted April 9, 2014 Share Posted April 9, 2014 Did you find the Answer for your problem ? Link to comment Share on other sites More sharing options...
PascalVG Posted April 22, 2014 Share Posted April 22, 2014 Hi med6, try this: in file: /controllers/front/CartController.php (make backup, just in case): in function: protected function processChangeProductInCart() Somewhere half way the function, add these red pieces of code (sample code of P.S. 1.5.5.0) ... // If no errors, process product addition if (!$this->errors && $mode == 'add') { if ($this->context->cart->id) // Check if already a product in cart. Check for only one product per order... { if ($this->context->cart->nbProducts() > 0) // change 0 to higher number if needed $this->errors[] = Tools::displayError('Only one product per order is allowed. Please continue to checkout'); } // Add cart if no cart found if (!$this->errors) { if (!$this->context->cart->id) { if (Context::getContext()->cookie->id_guest) { $guest = new Guest(Context::getContext()->cookie->id_guest); $this->context->cart->mobile_theme = $guest->mobile_theme; } $this->context->cart->add(); if ($this->context->cart->id) $this->context->cookie->id_cart = (int)$this->context->cart->id; } // Check customizable fields if (!$product->hasAllRequiredCustomizableFields() && !$this->customization_id) $this->errors[] = Tools::displayError('Please fill in all of the required fields, and then save your customizations.'); } // <- close if statement as well! if (!$this->errors) { $cart_rules = $this->context->cart->getCartRules(); ... That should do it, I think. pascal. 2 Link to comment Share on other sites More sharing options...
Med6 Posted April 23, 2014 Share Posted April 23, 2014 Hi med6, try this: in file: /controllers/front/CartController.php (make backup, just in case): in function: protected function processChangeProductInCart() Somewhere half way the function, add these red pieces of code (sample code of P.S. 1.5.5.0) ... // If no errors, process product addition if (!$this->errors && $mode == 'add') { if ($this->context->cart->id) // Check if already a product in cart. Check for only one product per order... { if ($this->context->cart->nbProducts() > 0) // change 0 to higher number if needed $this->errors[] = Tools::displayError('Only one product per order is allowed. Please continue to checkout'); } // Add cart if no cart found if (!$this->errors) { if (!$this->context->cart->id) { if (Context::getContext()->cookie->id_guest) { $guest = new Guest(Context::getContext()->cookie->id_guest); $this->context->cart->mobile_theme = $guest->mobile_theme; } $this->context->cart->add(); if ($this->context->cart->id) $this->context->cookie->id_cart = (int)$this->context->cart->id; } // Check customizable fields if (!$product->hasAllRequiredCustomizableFields() && !$this->customization_id) $this->errors[] = Tools::displayError('Please fill in all of the required fields, and then save your customizations.'); } // <- close if statement as well! if (!$this->errors) { $cart_rules = $this->context->cart->getCartRules(); ... That should do it, I think. pascal. This isn't what I want; I want to limit the qty ;You have right to add to cart only 3 item per product Link to comment Share on other sites More sharing options...
PascalVG Posted April 23, 2014 Share Posted April 23, 2014 This is the answer to the question asked...1 item for only 1 product... 8-[ Please open a new topic if you want to ask a DIFFERENT question.. Don't hijack this topic... Then please PM me the link to the new topic and I will have another look at it. (Will be begin next week, as I will be away for three days) Link to comment Share on other sites More sharing options...
Med6 Posted April 23, 2014 Share Posted April 23, 2014 I ve been search for this in weeksCan you please help me today because I have to deliver my school projet tomorrow http://www.prestashop.com/forums/topic/325631-limit-quantity-order-for-all-products/ Link to comment Share on other sites More sharing options...
PascalVG Posted April 24, 2014 Share Posted April 24, 2014 Hi med6, I gave (hopefully) some solution in the new topic you opened. Please have a look there. Cheers, pascal. Link to comment Share on other sites More sharing options...
HenrikBoyander Posted June 6, 2016 Share Posted June 6, 2016 Hi, Thanks for information. I am not a programmer so want to ask what need to be changed if I want to limit the order to maximum 5 items, applying to any combination, no more than a total of 5 items can be ordered? Thanks a bunch! Link to comment Share on other sites More sharing options...
tinathegeek Posted February 27, 2017 Share Posted February 27, 2017 Pascal this limits every product to quantity of 1. I would like to limit some products to 9 and some to 13 quantity. How can I do this per product. The modules there do not address this specifically either. Is there a way to specify it in the product when adding to cart as well. I would rather the person see it at the product page and not wait until he gets to the cart to see the message as well. Link to comment Share on other sites More sharing options...
Recommended Posts