guest* Posted August 28, 2010 Share Posted August 28, 2010 Is there any modul for ? I have 5 customer groups and for 2 of this I need to have a minimum order possibility. Link to comment Share on other sites More sharing options...
rocky Posted August 29, 2010 Share Posted August 29, 2010 It's not possible in PrestaShop without modifying code. You'll need to change line 31 of order.php from: $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM')); to: $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM')); if (intval($cookie->id_customer) > 0) { $customer = new Customer(intval($cookie->id_customer)); if ($customer->isMemberOfGroup(1)) $minimalPurchase = 200; elseif ($customer->isMemberOfGroup(2)) $minimalPurchase = 300; else $minimalPurchase = 0; } This code will force all customers in group 1 to purchase $200 before checking out and all customers in group 2 to purchase $300 before checking out. All other customers have no minimum. Change the group IDs and amounts as appropriate for your site. 1 Link to comment Share on other sites More sharing options...
guest* Posted August 29, 2010 Author Share Posted August 29, 2010 OK, Thx, so if it is only possible by hardcode I will ammend this...... and it works... Thx. Link to comment Share on other sites More sharing options...
olea Posted August 29, 2010 Share Posted August 29, 2010 I propose a module that allows to :-- specify a minimum purchase per group-- specifiy per grouop if OutOfStock products is allowed or not.This allows to manage individual customer that can not order OutOfStock products, and pros customer that can order OutOfStock and that have to purchase a minimum Link to comment Share on other sites More sharing options...
wifi-online Posted April 16, 2011 Share Posted April 16, 2011 Hi, as you can set the code, to display an error if you have not reached the minimum amount?Someone has already created the module?Thanks. Link to comment Share on other sites More sharing options...
guest* Posted April 28, 2011 Author Share Posted April 28, 2011 Is there any module or a new hack for the version 1.4. ? Code does not work anymore. Link to comment Share on other sites More sharing options...
guest* Posted April 28, 2011 Author Share Posted April 28, 2011 Hi, as you can set the code, to display an error if you have not reached the minimum amount?Someone has already created the module?Thanks. What do you mean ? There is a bug in the 1.4.0.17 that the message: you don't have reached minim order, is not displaying anymore. This is fixed in 1.4.1.I cannot update to 1.4.1. due to another bug, but I confirm that the hack posted for 1.3. does not work with 1.4.. It does no more selection of the groups. I think the problem is that customer must be less in Standard and than also in his other group. A selection of only ONE group is not possible for me. Only Standard and second group. Link to comment Share on other sites More sharing options...
wifi-online Posted June 5, 2011 Share Posted June 5, 2011 Hi, there is something for the version 1.4.1925, which works for minimun order?Thanks. Link to comment Share on other sites More sharing options...
Ricco Posted June 25, 2011 Share Posted June 25, 2011 can i modify code in prestashop 1.4.0.17 ? I cant edit like said rocky because in this version variable $minimalPurchase missing in order.phpthx Link to comment Share on other sites More sharing options...
guest* Posted June 25, 2011 Author Share Posted June 25, 2011 can i modify code in prestashop 1.4.0.17 ? I cant edit like said rocky because in this version variable $minimalPurchase missing in order.phpthx No news, unfortunatelly from 1.4. onwards not possible anymore, unless somebody codes a module for that... Link to comment Share on other sites More sharing options...
ShiokGuy Posted July 11, 2011 Share Posted July 11, 2011 Dear AllI am using 1.4.3 final Just installed.I have 2 groups of user, Retail and Wholesales.For wholesales, the min order qty per order is 10. Meaning they can buy any product combination up to 10, then they can check out. This is not min 10 per items, but min 10 items per order.For retail: They can check out even with 1 item.Secondly..I would like to have 2 pricing shown on my website, Retail and Wholesales: Is that anyway I can do that?RegardsShiokGuy Link to comment Share on other sites More sharing options...
Mishta Posted November 29, 2011 Share Posted November 29, 2011 You can use 2 prices for one product using the price tab in product page (admin area). You can write a specific price for curency / country / group. Link to comment Share on other sites More sharing options...
ZenGraph Posted December 2, 2011 Share Posted December 2, 2011 Hello to all, As I have the same issue, I decided to look into my presta 1.4.5.1 version and I did this little modification for the customer group ID 4 : 'Resellers' that need a minimum amount order to be set to 400$. So I did activate the minimal order in prestashop, set it up to 400$ and modified this file :> OrderOpcController.php (because I use One Page Checkout !) around line 394 /* Check minimal amount */ BEFORE : /* 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>'; AFTER : /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cookie->id_customer) { $customer = new Customer((int)(self::$cookie->id_customer)); $groupes = $customer->getGroups(); } else $groupes = array(1); if ((self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) and ($groupes[0]==4)) 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>'; And That Works !! Only the Customers from group ID 4 (by default) will have this limitation of Minimal purchase activated ! If you need more group ID filters just modifiy the code to make it happen in the way rocky shows above (by the way, it took me some time before I found that "ismemberofgroup" function is deprecated in 1.4.) I Still Do need Help :> How to put this modifications in Overrides directory...so next update it will keep on working. Best Regards to all Link to comment Share on other sites More sharing options...
ZenGraph Posted January 3, 2012 Share Posted January 3, 2012 Thanks to Broceliande for his help on IRC. Everything is under override now, very simple to do in fact. Best Regards, Zen Link to comment Share on other sites More sharing options...
metalice Posted January 19, 2012 Share Posted January 19, 2012 Hello to all, As I have the same issue, I decided to look into my presta 1.4.5.1 version and I did this little modification for the customer group ID 4 : 'Resellers' that need a minimum amount order to be set to 400$. So I did activate the minimal order in prestashop, set it up to 400$ and modified this file :> OrderOpcController.php (because I use One Page Checkout !) around line 394 /* Check minimal amount */ BEFORE : /* 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>'; AFTER : /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cookie->id_customer) { $customer = new Customer((int)(self::$cookie->id_customer)); $groupes = $customer->getGroups(); } else $groupes = array(1); if ((self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase) and ($groupes[0]==4)) 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>'; And That Works !! Only the Customers from group ID 4 (by default) will have this limitation of Minimal purchase activated ! If you need more group ID filters just modifiy the code to make it happen in the way rocky shows above (by the way, it took me some time before I found that "ismemberofgroup" function is deprecated in 1.4.) I Still Do need Help :> How to put this modifications in Overrides directory...so next update it will keep on working. Best Regards to all hi there, it works , but i found a bug , once you have reach a minimum of lets say 400$ , like in the code example, i mean add product to your cart in 400$ value, now you can see the payment options, you can remove items from your cart, lets say you have removed 1 item in the value of 100$ , now you still see the payment options, and your cart is only 300$ and you can continue to payment process. only if you refresh your cart you will see it again the blocking of the 400$ minimum. i think its because of the ajax cart. any way to fix it? thanks Matan Link to comment Share on other sites More sharing options...
metalice Posted January 19, 2012 Share Posted January 19, 2012 any1 got an solution for that? Link to comment Share on other sites More sharing options...
ZenGraph Posted January 19, 2012 Share Posted January 19, 2012 any1 got an solution for that? hello metalice.. I noticed this bug also.. but as I am not an "Ajax " technician I could not think about debuging that. I wish also someone can help us to sort it out Link to comment Share on other sites More sharing options...
metalice Posted January 22, 2012 Share Posted January 22, 2012 yep.. need to find someoe that know is way in ajax Link to comment Share on other sites More sharing options...
juavillo Posted January 26, 2012 Share Posted January 26, 2012 I have the same problem. The bug is PSCFI-3640 http://forge.prestashop.com/browse/PSCFI-3640 Link to comment Share on other sites More sharing options...
juavillo Posted January 27, 2012 Share Posted January 27, 2012 Hello. This bug is solved in SVN version: http://svn.prestashop.com/trunk/themes/prestashop/js/cart-summary.js You only need to change this file. To try it, make a backup of the file, copy new file to your server and clear the browser cache to test it. Link to comment Share on other sites More sharing options...
ZenGraph Posted January 28, 2012 Share Posted January 28, 2012 Hello. This bug is solved in SVN version: http://svn.prestasho...cart-summary.js You only need to change this file. To try it, make a backup of the file, copy new file to your server and clear the browser cache to test it. I just tryed this new version and I have more problems with this one on a 1.4.5.3 version, with this cart-summary.js file the total amount of the cart is not updated on onepage checkout when you modifiy quantity of an article. Link to comment Share on other sites More sharing options...
1337 Posted February 19, 2012 Share Posted February 19, 2012 How to set minimumPurchase amount for a group in Presta 1.4.7.0: if (self::$cookie->id_customer) { $customer = new Customer((int)(self::$cookie->id_customer)); if ($customer->isMemberOfGroup(???)) $minimalPurchase = ???; } replace ??? with your variables! Link to comment Share on other sites More sharing options...
OmarRu Posted April 2, 2012 Share Posted April 2, 2012 Les cuento en español, porque no tengo gans de ponerme a escribir en ingles... La solución, por lo menos para mi, con Prestashop 1.4.4. Es asi: Editan el archivo \controllers\OrderController.php Y reemplazan desde la linea 56: /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $orderTotal = self::$cart->getOrderTotal(); $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); if (self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase && $this->step != -1) { $this->step = 0; $this->errors[] = Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). ' '.Tools::displayError('is required in order to validate your order.'); } if (!self::$cookie->isLogged(true) AND in_array($this->step, array(1, 2, 3))) Tools::redirect('authentication.php?back='.urlencode('order.php?step='.$this->step)); if ($this->nbProducts) self::$smarty->assign('virtual_cart', $isVirtualCart); } public function displayHeader() { if (!Tools::getValue('ajax')) parent::displayHeader(); } public function process() { parent::process(); POR ESTO: /* Check minimal amount */ $currency = Currency::getCurrency((int)self::$cart->id_currency); $orderTotal = self::$cart->getOrderTotal(); if (self::$cookie->id_customer) { $customer = new Customer((int)(self::$cookie->id_customer)); $groupes = $customer->getGroups(); } else $groupes = array(1); if ($groupes[0]==1) $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); elseif ($groupes[0]==2) $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency)*6; if (self::$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimalPurchase && $this->step != -1) { $this->step = 0; $this->errors[] = Tools::displayError('A minimum purchase total of').' '.Tools::displayPrice($minimalPurchase, $currency). ' '.Tools::displayError('is required in order to validate your order.'); } if (!self::$cookie->isLogged(true) AND in_array($this->step, array(1, 2, 3))) Tools::redirect('authentication.php?back='.urlencode('order.php?step='.$this->step)); if ($this->nbProducts) self::$smarty->assign('virtual_cart', $isVirtualCart); } public function displayHeader() { if (!Tools::getValue('ajax')) parent::displayHeader(); } public function process() { parent::process(); En este caso, yo tengo 2 grupos de clientes, 1 con un descuento del 25% y el otro con un descuento del 35%. Para el primero, el monto mínimo es $500 y para el segundo $3000, si se fijan, ('PS_PURCHASE_MINIMUM'), $currency esta multiplicado por 6. Ya que en el BackOffice, configuré a $500 el monto mínimo de compra. Espero lo puedan solucionar. Aparentemente la proxima versión de Prestashop, trae esta configuración incluida en el BackOficce! Les dejo mi sitio Web, para que puedan visitarlo. http://www.oplenceria.com.ar Muchas gracias! Link to comment Share on other sites More sharing options...
kashifkhan112 Posted January 12, 2013 Share Posted January 12, 2013 Can you please provide this code for Prestashop 1.5 structure. Thanks Link to comment Share on other sites More sharing options...
dpcdpc11 Posted January 19, 2013 Share Posted January 19, 2013 here is my solution for PS 1.5.3.1: http://www.prestasho...ost__p__1074792 Link to comment Share on other sites More sharing options...
marco989 Posted February 18, 2013 Share Posted February 18, 2013 It's not possible in PrestaShop without modifying code. You'll need to change line 31 of order.php from: $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM')); to: $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM')); if (intval($cookie->id_customer) > 0) { $customer = new Customer(intval($cookie->id_customer)); if ($customer->isMemberOfGroup(1)) $minimalPurchase = 200; elseif ($customer->isMemberOfGroup(2)) $minimalPurchase = 300; else $minimalPurchase = 0; } This code will force all customers in group 1 to purchase $200 before checking out and all customers in group 2 to purchase $300 before checking out. All other customers have no minimum. Change the group IDs and amounts as appropriate for your site. HI rocky does your solution work for PS 1.3.6 as well? I use PS 1.3.6 and i would like to display a specific text message when a customer from the Group X (not conditioned by his/her name of his/her customer id) is logged in. I tried the following combinations: {if $logged} {if isset($id_group) and $id_group==3} <p class="warning"> Show this message 1 </p> {else} <p class="warning"> Show message 2 </p> {/if} {/if} This option does not work ok and it displays the text in the {else} condition only. I tried as well {if $logged} {if (self::$cookie->id_customer)} {$customer = new Customer(intval($this->id_customer)); $customer->getGroups()} {if ($customer_group==3)} <p class="warning"> Show message 1 </p> {else} <p> Show message 2 </p> {/if} {/if} {/if} This code disables the body of the page completely. Any tips on how to code it correctly? Again, this is about showing a specific text message to a customer, depending on the group he's in (as set in the back office), independent of the name of the customer or the customer id. version PS 1.3.6 Link to comment Share on other sites More sharing options...
marco989 Posted February 22, 2013 Share Posted February 22, 2013 Got it. Here is the solution in case anyone wants to add whatever message on the customer's account page, addresses page or whatever page, by performing a conditional check according to the group to which the customer belongs (verified on PS 1.3.6) Add on the my-account.tpl or whichever tpl you want, where you want the message to appear, the following code: <div> {if ($logged)} { $customer = new Customer($cookie->id_customer); if (!$customer->isMemberOfGroup(3));} <p class="warning"> Show message 1 </p> {else} <p> Show message 2 </p> {/if} </div> The above checks the condition id_group id_customer and isMemberofGroup and displays the corresponding warning or message. Tags: if condition $id_group $id_customer ismemeberofgroup Partial credits go to rocky for his post; http://www.prestashop.com/forums/index.php?/topic/39431-php-help-needed-hide-everythingshop-until-a-user-logs-in/page__view__findpost__p__283507 Link to comment Share on other sites More sharing options...
shariqafroz Posted November 6, 2013 Share Posted November 6, 2013 It's not possible in PrestaShop without modifying code. You'll need to change line 31 of order.php from: $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM')); to: $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM'));if (intval($cookie->id_customer) > 0){ $customer = new Customer(intval($cookie->id_customer)); if ($customer->isMemberOfGroup(1)) $minimalPurchase = 200; elseif ($customer->isMemberOfGroup(2)) $minimalPurchase = 300; else $minimalPurchase = 0;} This code will force all customers in group 1 to purchase $200 before checking out and all customers in group 2 to purchase $300 before checking out. All other customers have no minimum. Change the group IDs and amounts as appropriate for your site. Hi Rocky.. I am using 1.5.4.1 ,,, Can you please suggest if I wish to have a minimum quantity restriction and not of price,, For eaxample I want wholesale group to buy at least 25 items and it can be mix of items totalling to 25... Link to comment Share on other sites More sharing options...
RobstepWorld Posted January 2, 2014 Share Posted January 2, 2014 Hi Rocky.. I am using 1.5.4.1 ,,, Can you please suggest if I wish to have a minimum quantity restriction and not of price,, For eaxample I want wholesale group to buy at least 25 items and it can be mix of items totalling to 25... Also looking for this in 1.5.4.1. Any help would be fantastic. Link to comment Share on other sites More sharing options...
legionari86 Posted April 2, 2014 Share Posted April 2, 2014 Version 1.5.6.2 order.php where do I find? 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