vucumbra Posted December 31, 2016 Share Posted December 31, 2016 (edited) Maybe someone need this edit in /controllers/front/OrderController.php edit around 67 line from: $orderTotal = $this->context->cart->getOrderTotal(); $minimal_purchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); to $orderTotal = $this->context->cart->getOrderTotal(); $minimal_purchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); //Edit by VuCumBra $customer = new Customer((int)(self::$cookie->id_customer)); $groupes = $customer->getGroups(); if ($groupes[0]==3) { $minimal_purchase=300; } Just change the id group if ($groupes[0]==3) and the minimim amount $minimal_purchase=300; Hope this help Edited December 31, 2016 by vucumbra (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 1, 2017 Share Posted January 1, 2017 im affraid that this if condition will not work if customer will be associated with several groups its necessary to add foreach loop on $groupes variable 1 Link to comment Share on other sites More sharing options...
vucumbra Posted January 2, 2017 Author Share Posted January 2, 2017 (edited) Yes you are right veckia sorry i have used in_array it's correct now? //Edit by VuCumBra $customer = new Customer((int)(self::$cookie->id_customer)); $groupes = $customer->getGroups(); if (in_array("4", $groupes)) { $minimal_purchase=0; } else { $minimal_purchase=300; } Edited January 2, 2017 by vucumbra (see edit history) Link to comment Share on other sites More sharing options...
beepow Posted October 30, 2019 Share Posted October 30, 2019 Hi, In PS 1.6.1.14 I've changed $orderTotal = $this->context->cart->getOrderTotal(); $minimal_purchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); to $orderTotal = $this->context->cart->getOrderTotal(); $minimal_purchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); $customer = new Customer((int)(self::$cookie->id_customer)); $groupes = $customer->getGroups(); if (in_array("48", $groupes)) { $minimal_purchase=50; } else { $minimal_purchase=0; } where "48" is the ID for a custom group that should have the limitation of a minimum purchase of 50 pieces. Nothning happens. I've also tryed to put it as an ovveride in /override/controllers/front (and I've deleted /cache/class_index.php). What behavior should I expect instead? A warning text? 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