laguepe Posted August 31, 2013 Share Posted August 31, 2013 (edited) Bonjour, J'ai besoin d'aide, je souhaite créer un minimum de commande pour un groupe de client. Groupe concerné : ID 4 Minimum d'achat du groupe concerné : 150€ Autre groupe : pas de minimum J'ai bien cherché sur les forums mais je ne trouve pas de code adapté à ma version, qui la 1.5.4.1 Certains disent de modifier le dossier \prestashop\controllers\front\OrderController.php avec ce style de code : $minimalPurchase = floatval(Configuration::get('PS_PURCHASE_MINIMUM')); if (intval($cookie->id_customer) > 0) { $customer = new Customer(intval($cookie->id_customer)); if ($customer->isMemberOfGroup(4)) $minimalPurchase = 150; else $minimalPurchase = 0; } d'autres parlent du \prestashop\controllers\front\OrderOpcController.php avec ce code : /* Check minimal amount $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) 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>'; J'ai tester plusieurs formules sans y arriver. Un coup de main serait le bienvenue. Merci d'avance. Edited August 31, 2013 by laguepe (see edit history) 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