PierPier Posted January 18, 2012 Share Posted January 18, 2012 Hi all, I checked around, but I cannot found a solution to this problem even if a lot of people asks about. If I miss the solution please share the link. I need to solve the following issue: I need that my customers buy a minimal number of items to complete the order procedure. There are several shops that need this kind feature. Think for instance to a wineshop that sells 6 or more different bottles per order, but not less than 6 and additionally it has also different items that can be sold one by one. I found this post that fix this problem (for older version of PrestaShop) making some mod in the code, but that mod does not work for newer versions. I hope you can help me!! Thank you all!!! Link to comment Share on other sites More sharing options...
Richard S Posted January 18, 2012 Share Posted January 18, 2012 Hello, Have you tried setting Minimum quantity value in product creation tab? It is near stock movements and etc. What version of PrestaShop are you using? Link to comment Share on other sites More sharing options...
PierPier Posted January 19, 2012 Author Share Posted January 19, 2012 Hi Richard,I'm using PrestaShop 1.4. The minimum quantity in the product page imposes a minimum for that specific product/item, it says: "you have to buy X items of this kind to proceed". My problem is a little different cause it is not per-product, but per-order mininum quantity, this means that your order has to contain X items - in total - thus also of different kind.Example: you have a Kitcheware Store, you sell dishes, cutlery and tablecloth so you have several types of dishes, cutlery and tablecloth. You do not care how the customer aggregate the items, but you want that he has to buy at least 4 dishes, at least 12 pieces of cutlery and at least 1 tablecloth. So, for instance, if the customer try to buy 2 dishes he cannot finalize the order, but if he try to buy 5 dishes and 1 tablecloth everything is good.I hope this example explain my issue :-)Do you know any module that solves this? Modules that i find: minimal order by groups and minimal product quantity Link to comment Share on other sites More sharing options...
Richard S Posted January 19, 2012 Share Posted January 19, 2012 Hello, Yes, I know got your objective, but I am afraid I have seen this kind of module. However, it should not cost much to create one. Link to comment Share on other sites More sharing options...
PierPier Posted January 19, 2012 Author Share Posted January 19, 2012 You said you have seen it, could you please provide me a link? if it is a paid module is not a problem. Do you will able to create a module for that? How much it will cost? Thanks Link to comment Share on other sites More sharing options...
Richard S Posted January 19, 2012 Share Posted January 19, 2012 Sorry... it should have been "have not seen", that is my mistake, sorry for that. For any other discussions you might contact me by email (contact form in my website look below) or PM. Link to comment Share on other sites More sharing options...
HandCraft Posted January 21, 2012 Share Posted January 21, 2012 really surprising that such an important feature is missing in Prestashop..........we are basically wholesalers and not retailers but still due to absence of this "Min Buy Quantity" feature we are selling one one item. Selling single item is not at all cost effective for us. People here advice to use "min amount feature" but it is useless coz our pricing ranges are wide and moreover we are talking about min quantity to be purchased n not min products to be sold per order. Hope some genius will solve our problem or at least Presta team will work over it. Link to comment Share on other sites More sharing options...
tomerg3 Posted January 23, 2012 Share Posted January 23, 2012 Here's a little mod to convert the total order amount minimum to a product quantity minimum (I will show how to modify the core file, you should create an override file if you plan on upgrading your shop). This code is found in /controllers/OrderController.php (5 step checkout), or OrderOpcController.php (express checkout). Current code (taken from PS 1.4.6.2) /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). ' '.Tools::displayError('is required in order to validate your order.').'</p>'; New Code /* Check minimal amount */ $minimalPurchase = (float)Configuration::get('PS_PURCHASE_MINIMUM'); if (self::$cart->nbProducts() < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.$minimalPurchase. ' '.Tools::displayError('Products is required in order to validate your order.').'</p>'; I haven't tested, but it should work. Let us know how it goes. Link to comment Share on other sites More sharing options...
HandCraft Posted January 23, 2012 Share Posted January 23, 2012 Thanks but unless n until it is tested and proven feels bit risky to try it..... Here's a little mod to convert the total order amount minimum to a product quantity minimum (I will show how to modify the core file, you should create an override file if you plan on upgrading your shop). This code is found in /controllers/OrderController.php (5 step checkout), or OrderOpcController.php (express checkout). Current code (taken from PS 1.4.6.2) /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). ' '.Tools::displayError('is required in order to validate your order.').'</p>'; New Code /* Check minimal amount */ $minimalPurchase = (float)Configuration::get('PS_PURCHASE_MINIMUM'); if (self::$cart->nbProducts() < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.$minimalPurchase. ' '.Tools::displayError('Products is required in order to validate your order.').'</p>'; I haven't tested, but it should work. Let us know how it goes. Link to comment Share on other sites More sharing options...
tomerg3 Posted January 23, 2012 Share Posted January 23, 2012 Then try it on a test server Link to comment Share on other sites More sharing options...
HandCraft Posted February 3, 2012 Share Posted February 3, 2012 Well anyone tried it? Thanks but unless n until it is tested and proven feels bit risky to try it..... Link to comment Share on other sites More sharing options...
Richard S Posted February 5, 2012 Share Posted February 5, 2012 tomerg3, This is only helps if you want to make one product to be purchased at certain amounts, but the main idea here is to make the restriction for category. By doing this you will be able to buy products A, B, C from category Cat1 only of the whole quantity of all products (A, B, C) is a certain amount. In addition, there should be an ability to add different quantity restrictions for different categories. Link to comment Share on other sites More sharing options...
tomerg3 Posted February 5, 2012 Share Posted February 5, 2012 but the main idea here is to make the restriction for category I did not see anyone ask about per category. while that is also possible, it requires more specific modification. Hopefully what I posted can point whoever does need it to be category specific in the right direction... 1 Link to comment Share on other sites More sharing options...
Richard S Posted February 5, 2012 Share Posted February 5, 2012 Yes, you are right Link to comment Share on other sites More sharing options...
mani313 Posted July 1, 2013 Share Posted July 1, 2013 better solution, am also need this.i'll try it and reply thanx for the code..looks very simple Link to comment Share on other sites More sharing options...
enigma32 Posted October 5, 2013 Share Posted October 5, 2013 Here's a little mod to convert the total order amount minimum to a product quantity minimum (I will show how to modify the core file, you should create an override file if you plan on upgrading your shop). This code is found in /controllers/OrderController.php (5 step checkout), or OrderOpcController.php (express checkout). Current code (taken from PS 1.4.6.2) /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). ' '.Tools::displayError('is required in order to validate your order.').'</p>'; New Code /* Check minimal amount */ $minimalPurchase = (float)Configuration::get('PS_PURCHASE_MINIMUM'); if (self::$cart->nbProducts() < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.$minimalPurchase. ' '.Tools::displayError('Products is required in order to validate your order.').'</p>'; I haven't tested, but it should work.Let us know how it goes. Sorry to bump a long dead thread, but I'm running 1.4.8.2 for a wholesale site and looking to retain the minimum by value as it exists in presta already.... but i don't see where PS_PURCHASE_MINIMUM can even be declared aside from injecting it into the database myself Link to comment Share on other sites More sharing options...
heyciao Posted February 20, 2015 Share Posted February 20, 2015 I did not see anyone ask about per category. while that is also possible, it requires more specific modification. Hopefully what I posted can point whoever does need it to be category specific in the right direction... I know this is old post but I need exactly the minimum value (or quantity) by categories. You say that is also possibile, could you tell me how? Thank you. Luciano Link to comment Share on other sites More sharing options...
polybush me Posted February 28, 2015 Share Posted February 28, 2015 As above I know its an old post but I also need to be able to restrict orders so they have to order in min quantities. For instance we sell automotive gauges, in two different sizes (52 and 60mm) and 3 different face styles (Black Face, White Face and Clear Face). There is then 10 different types of gauge for each of those (boost, oil pressure, water temp etc...) Trade customers can order any type of gauge they want BUT the order total has to be a minimum order of 12 gauges. If anyone know how I can make it so a customer has to order a minimum of 12 products from a particular category then I could make that work. If anyone can help please let me know! Many Thanks Simon Link to comment Share on other sites More sharing options...
geoaguila Posted May 13, 2015 Share Posted May 13, 2015 Hello, For you to know, i already test this solution in prestashop 1.6, and it's working perfectly validating the Order's total quantity of products. Best regards, Geoaguila Link to comment Share on other sites More sharing options...
fmardones Posted February 25, 2016 Share Posted February 25, 2016 Hi, I tested the change recommended for tomerg3 and working!!! It was tested in 1.6.1.3 Thanks tomerg3 Link to comment Share on other sites More sharing options...
La Couture Galere Posted August 4, 2016 Share Posted August 4, 2016 Hi, I tested the change recommended for tomerg3 and working!!! It was tested in 1.6.1.3 Thanks tomerg3 Hello, For you to know, i already test this solution in prestashop 1.6, and it's working perfectly validating the Order's total quantity of products. Best regards, Geoaguila how did you did it? i cannot find /controllers/OrderController.php (5 step checkout), or OrderOpcController.php (express checkout). and cant find the line Link to comment Share on other sites More sharing options...
La Couture Galere Posted August 4, 2016 Share Posted August 4, 2016 Help me. I have PS 1.6 and want to set minimum order quantity per order. Any help is appreciated. Link to comment Share on other sites More sharing options...
La Couture Galere Posted August 9, 2016 Share Posted August 9, 2016 Here's a little mod to convert the total order amount minimum to a product quantity minimum (I will show how to modify the core file, you should create an override file if you plan on upgrading your shop). This code is found in /controllers/OrderController.php (5 step checkout), or OrderOpcController.php (express checkout). Current code (taken from PS 1.4.6.2) /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). ' '.Tools::displayError('is required in order to validate your order.').'</p>'; New Code /* Check minimal amount */ $minimalPurchase = (float)Configuration::get('PS_PURCHASE_MINIMUM'); if (self::$cart->nbProducts() < $minimalPurchase) return '<p class="warning">'.Tools::displayError('A minimum purchase total of').' '.$minimalPurchase. ' '.Tools::displayError('Products is required in order to validate your order.').'</p>'; I haven't tested, but it should work.Let us know how it goes. how about PS 1.6? Help me please Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted November 26, 2016 Share Posted November 26, 2016 Help me. I have PS 1.6 and want to set minimum order quantity per order. Any help is appreciated. i think it's easy,there is a total quantity label in the shopping cart, just add a click even for the check out button, 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