kashifkhan112 Posted January 12, 2013 Share Posted January 12, 2013 Can anyone explain how we can set minimum order price per each customer group. Thanks Link to comment Share on other sites More sharing options...
Bill Dalton Posted January 12, 2013 Share Posted January 12, 2013 This page explains it very well, http://doc.prestashop.com/display/PS15/Creating+Price+Rules+And+Vouchers The first part of the page is related to Cart Rules. These will come in handy down the road. Scroll down to the second section “Catalog price rules”. That’s what you want right now. Hope this helps. 1 Link to comment Share on other sites More sharing options...
kashifkhan112 Posted January 12, 2013 Author Share Posted January 12, 2013 I will read this doc link and will apply it. I will leave feedback around. Thanks Link to comment Share on other sites More sharing options...
kashifkhan112 Posted January 12, 2013 Author Share Posted January 12, 2013 (edited) Cart rule is not working for everyone or to a specific customer group, please find attachment Edited January 12, 2013 by kashifkhan112 (see edit history) Link to comment Share on other sites More sharing options...
kashifkhan112 Posted January 12, 2013 Author Share Posted January 12, 2013 This page explains it very well, http://doc.prestasho...es+And+Vouchers The first part of the page is related to Cart Rules. These will come in handy down the road. Scroll down to the second section “Catalog price rules”. That’s what you want right now. Hope this helps. ______________________________________________________________________ I just want to restrict a specific customer group minimum order limit i.e $100, no need discount, voucher etc. This functionality is not in 'Catalog price rules' or in 'Cart rule' Link to comment Share on other sites More sharing options...
Bill Dalton Posted January 12, 2013 Share Posted January 12, 2013 Ok, I guess I did not zero in on exactly what you want to do. Please read the following and let me know if that is closer to what you need. (Sorry to keep giving you links, but it's better than typing) How to set a minimum amount for cart rules in PrestaShop 1.5 Written By: Scott Mitchell http://www.inmotionhosting.com/support/edu/prestashop-15/pshop15-price-rules/set-min-amount Restrict cart rules to work with certain groups in PrestaShop 1.5 Written By: Scott Mitchell http://www.inmotionhosting.com/support/edu/prestashop-15/pshop15-price-rules/specific-customer-group Link to comment Share on other sites More sharing options...
kashifkhan112 Posted January 12, 2013 Author Share Posted January 12, 2013 Ok, I guess I did not zero in on exactly what you want to do. Please read the following and let me know if that is closer to what you need. (Sorry to keep giving you links, but it's better than typing) How to set a minimum amount for cart rules in PrestaShop 1.5 Written By: Scott Mitchell http://www.inmotionh.../set-min-amount Restrict cart rules to work with certain groups in PrestaShop 1.5 Written By: Scott Mitchell http://www.inmotionh...-customer-group I really appreciate, you are helping me to find the solution. I have followed the above links carefully. I have create a new cart rule with minimum $150 price and i have select all 'Customer group selection' listed customers, but when i add products to cart and goes to opc page, after logged in, i have not found any notification to restrict me minimum $150. I have cleared browser and project cache, but no any solution. 1 Link to comment Share on other sites More sharing options...
Bill Dalton Posted January 12, 2013 Share Posted January 12, 2013 I now see your problem very clear. Sorry it took me so long. It is very easy to set the limit for the entire store. Preferences > Orders > Minimum purchase total required in order to validate order That is a quick easy way to set the limit for the entire store. But this setting would be MUCH more useful if it applied to Groups. For example when you create a group Prestashop offers a way to apply a discount to the Group members, and if this option was there as well it would be very useful to wholesale shops. I searched the forums and I see you have already found a related thread were solutions have been hard coded in earlier versions of Prestashop. I would very much appreciate that if/when you find the answer that you post the solution here. It would be very much appreciated. Also if anyone reading has a solution I hope you will let us know. Link to comment Share on other sites More sharing options...
kashifkhan112 Posted January 13, 2013 Author Share Posted January 13, 2013 (edited) I now see your problem very clear. Sorry it took me so long. It is very easy to set the limit for the entire store. Preferences > Orders > Minimum purchase total required in order to validate order That is a quick easy way to set the limit for the entire store. But this setting would be MUCH more useful if it applied to Groups. For example when you create a group Prestashop offers a way to apply a discount to the Group members, and if this option was there as well it would be very useful to wholesale shops. I searched the forums and I see you have already found a related thread were solutions have been hard coded in earlier versions of Prestashop. I would very much appreciate that if/when you find the answer that you post the solution here. It would be very much appreciated. Also if anyone reading has a solution I hope you will let us know. Yes it is good, but i still need to set separately minimum order price per each customer group. i found "Caution! The rule will automatically be applied if you leave this field blank" in 'Cart rules' is not working. I have tested it in new versions 1.5.3 and 1.5.3.1, but still automatically rule is not applying. Anyway, I am still working on it, if i will find any solution, i will must share, Thanks Edited January 13, 2013 by kashifkhan112 (see edit history) 1 Link to comment Share on other sites More sharing options...
leobardo Posted January 16, 2013 Share Posted January 16, 2013 I am also searching exactly for the same, forced minimum order by group, please let me know if you found the way, I will do the same, I´m using prestashop 1.5, thanks 1 Link to comment Share on other sites More sharing options...
dpcdpc11 Posted January 17, 2013 Share Posted January 17, 2013 I got here searching for the same exact thing! Couldn't find a solution yet. I think is pretty stupid that this option is not included into prestashop! What I need is a bit more complicated: - I want for a certain group of clients to be able to order only if they have a minimum total price value of products from manufacturer A or a minimum weight value of products from Manufacturer B. What if we made a cart rule (using the minimum order condition) with a certain cupon and force this cupon onto the clients Group we want it to apply? Or something like that. I really need this option and I would pay for it if someone could do it! Link to comment Share on other sites More sharing options...
dpcdpc11 Posted January 19, 2013 Share Posted January 19, 2013 This was driving me crazy as well so I found a way to make it work with PS 1.5.3.1. Here's how I did it: If you're using One Page Checkout, edit OrderOpcController.php. Find the line 452 and replace this: /* Check minimal amount */ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; with this: /* Check minimal amount dpcdpc11*/ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $customer = new Customer((int)($this->context->customer->id)); $groupes = $customer->getGroups(); if ($groupes[0]==THE ID OF YOUR CLIENT GROUP) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; Now I want to take this even further and impose on this Client Group a restriction of a certain minimum Weight amount of a certain Manufacturer or a minimum total price of another Manufacturer. I've managed to add the Weight limit but I dunno how to deal with the Manufacturer limit... here is how far I've got: /* Check minimal amount dpcdpc11*/ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $customer = new Customer((int)($this->context->customer->id)); $groupes = $customer->getGroups(); if ($groupes[0]==4) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) > $minimalPurchase || $this->context->cart->getTotalWeight() > 100) { } else return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; I know it can be done but I don't have best programmer's skills. So any help would be much appreciated! Link to comment Share on other sites More sharing options...
Guest Posted February 3, 2013 Share Posted February 3, 2013 This was driving me crazy as well so I found a way to make it work with PS 1.5.3.1. Here's how I did it: If you're using One Page Checkout, edit OrderOpcController.php. Find the line 452 and replace this: /* Check minimal amount */ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; with this: /* Check minimal amount dpcdpc11*/ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $customer = new Customer((int)($this->context->customer->id)); $groupes = $customer->getGroups(); if ($groupes[0]==THE ID OF YOUR CLIENT GROUP) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; Now I want to take this even further and impose on this Client Group a restriction of a certain minimum Weight amount of a certain Manufacturer or a minimum total price of another Manufacturer. I've managed to add the Weight limit but I dunno how to deal with the Manufacturer limit... here is how far I've got: /* Check minimal amount dpcdpc11*/ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $customer = new Customer((int)($this->context->customer->id)); $groupes = $customer->getGroups(); if ($groupes[0]==4) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) > $minimalPurchase || $this->context->cart->getTotalWeight() > 100) { } else return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; I know it can be done but I don't have best programmer's skills. So any help would be much appreciated! @dpcdpc11 Am I reading this correctly? I set the minimum order value for the whole shop at say £200 I set up a group with an ID of 10 called "Trade" In your code I put if ($groupes[0]==10) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; I have changed the ID of the group to 10 (the trade group) Then what happens is that on check out a default customer will be subject to a minimum order value of £1 ($minimalPurchase = 1;) but anyone in the Trade group will get £200 minimum order? Link to comment Share on other sites More sharing options...
dpcdpc11 Posted February 4, 2013 Share Posted February 4, 2013 @haylau yes, that's correct. Link to comment Share on other sites More sharing options...
Guest Posted February 4, 2013 Share Posted February 4, 2013 @haylau yes, that's correct. excellent - works a treat! Link to comment Share on other sites More sharing options...
Radu Posted February 5, 2013 Share Posted February 5, 2013 in the same orderopc file, after: $currency = Currency::getCurrency((int)$this->context->cart->id_currency); add: /********* restrictions START ******************/ /* config data start */ $ID_manufacturer_with_price_restriction = 1; $ID_manufacturer_with_weight_restriction = 2; $ID_customer_group = 3; $min_total_price_for_defined_manufacturer = 1000; $min_total_weight_for_defined_manufacturer = 100; /* config data end */ //init variables $allow_to_order = true; $total_price_for_defined_manufacturer = 0; $total_weight_for_defined_manufacturer = 0; if($this->context->customer->id_default_group == $ID_customer_group) { $products = $this->context->cart->getProducts(); foreach($products as $product) { if($product['id_manufacturer'] == $ID_manufacturer_with_price_restriction) { $total_price_for_defined_manufacturer += $product['total']; } if($product['id_manufacturer'] == $ID_manufacturer_with_weight_restriction) { $total_weight_for_defined_manufacturer += $product['weight']; } } if($total_price_for_defined_manufacturer < $min_total_price_for_defined_manufacturer && $total_weight_for_defined_manufacturer < $min_total_weight_for_defined_manufacturer) { $allow_to_order = false; } if($allow_to_order === false) { return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d or of %d weight is required in order to validate your order.'), $min_total_price_for_defined_manufacturer, $min_total_weight_for_defined_manufacturer ).'</p>'; } } /********* restrictions END ******************/ Link to comment Share on other sites More sharing options...
faDdy Posted June 28, 2013 Share Posted June 28, 2013 Hello, Ccan anyone help me for this customization for 1.4.8.2 ? Thanks Link to comment Share on other sites More sharing options...
kashifkhan112 Posted July 3, 2013 Author Share Posted July 3, 2013 contact me via Skype: kashif.murtaza1 Hello, Ccan anyone help me for this customization for 1.4.8.2 ? Thanks Link to comment Share on other sites More sharing options...
paulormf Posted September 16, 2013 Share Posted September 16, 2013 This was driving me crazy as well so I found a way to make it work with PS 1.5.3.1. Here's how I did it: If you're using One Page Checkout, edit OrderOpcController.php. Find the line 452 and replace this: /* Check minimal amount */ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>';with this: /* Check minimal amount dpcdpc11*/ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $customer = new Customer((int)($this->context->customer->id)); $groupes = $customer->getGroups(); if ($groupes[0]==THE ID OF YOUR CLIENT GROUP) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>';Now I want to take this even further and impose on this Client Group a restriction of a certain minimum Weight amount of a certain Manufacturer or a minimum total price of another Manufacturer.I've managed to add the Weight limit but I dunno how to deal with the Manufacturer limit... here is how far I've got: /* Check minimal amount dpcdpc11*/ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $customer = new Customer((int)($this->context->customer->id)); $groupes = $customer->getGroups(); if ($groupes[0]==4) $minimalPurchase = Tools::convertPrice(Configuration::get('PS_PURCHASE_MINIMUM'), $currency); else $minimalPurchase = 1; if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) > $minimalPurchase || $this->context->cart->getTotalWeight() > 100) { } else return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %d is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>';I know it can be done but I don't have best programmer's skills.So any help would be much appreciated! --- hi, if i use 5 pages checkout? would ordercontroller.php around line 55? change the same code? Thank you for providing the code.. Link to comment Share on other sites More sharing options...
alasso Posted March 11, 2014 Share Posted March 11, 2014 Hello, I have tried your solution in 1.5.6.1, but it didn´t work. When I have launched in Chart I have encountered with a blank page. Do you know a new code for this version? Thanks. Link to comment Share on other sites More sharing options...
Dolke Posted August 12, 2014 Share Posted August 12, 2014 Hi Guys, I don't have needs for having this feature for each group separably yet, I'm ok with the global limit for the all orders. Today this happened:You can see that limit is set: http://prntscr.com/4c05f9How the hell this happened: http://prntscr.com/4c05u2 Any idea? Link to comment Share on other sites More sharing options...
gr_fenix Posted April 21, 2015 Share Posted April 21, 2015 Hi everyone, I have a catalog rule with a discount for a specific customer group but I want this discount if the order has a minium value. I'm using PS 1.6.X but I can find this feature. Thanks Link to comment Share on other sites More sharing options...
ArsalanAnsari Posted July 19, 2016 Share Posted July 19, 2016 In orderopccontroller.php line# 586 /* Check minimal amount */ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); $minimal_purchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); $groups = Customer::getGroupsStatic((int)$this->context->cart->id_customer); $whgroup = false; foreach ($groups as $g) { if($g == 4) $whgroup = true; } if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimal_purchase && $whgroup) { return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %1s (tax excl.) is required to validate your order, current purchase total is %2s (tax excl.).'), Tools::displayPrice($minimal_purchase, $currency), Tools::displayPrice($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS), $currency) ).'</p>'; } Link to comment Share on other sites More sharing options...
La Couture Galere Posted August 8, 2016 Share Posted August 8, 2016 Im looking for minimum order quantity per order, so it means any assorted items per order with atleast (example 6pcs). I using PS 1.6 any help? Link to comment Share on other sites More sharing options...
lozal2244 Posted November 29, 2016 Share Posted November 29, 2016 Hello, maybe this module is useful for you: http://addons.prestashop.com/fr/22442-minimum-price-by-manufacturer.html Link to comment Share on other sites More sharing options...
Recommended Posts