Jump to content
Sign in to follow this  
piR-web

Montant minimal de commande sauf si dans le panier un des produit à un prix unitaire inférieur à 1 euros

Recommended Posts

Bonjour,

 

Je suis sur Prestashop 1.6 et j'aimerais mettre un montant minimal de commande à 300 euros (jusqu'ici tout va bien) sauf si dans le panier un des produit à un prix unitaire inférieur à 1 euros.

Cela doit se passer dans OrderOpcController.php 

/* Check minimal amount */
        $currency = Currency::getCurrency((int)$this->context->cart->id_currency);

        $minimal_purchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency);
        if ($this->context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS) < $minimal_purchase) {
            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>';
        }

 

Quelqu'un aurait-il une idée ?

 

Merci :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More