m3442a Posted April 15, 2014 Share Posted April 15, 2014 (edited) Hello, have a little bit problem with the minimum amount solution. i need for virtual products (selling vouchers ) a minimum amount = 0, for all other physically products i have the standard Minimum purchasing limit. How can developing the system if i buying the virtual product than the showing the payments? I try this in the controllers/front/OrderOpcController.php /* Check minimal amount */ $currency = Currency::getCurrency((int)$this->context->cart->id_currency); if ($product->is_virtual) $minimalPurchase = 0; else $minimalPurchase = Tools::convertPrice((float)Configuration::get('PS_PURCHASE_MINIMUM'), $currency); but not work Thanks for help Edited April 15, 2014 by m3442a (see edit history) Link to comment Share on other sites More sharing options...
m3442a Posted April 17, 2014 Author Share Posted April 17, 2014 No one has a idea? Or its not working with Prestashop? Link to comment Share on other sites More sharing options...
m3442a Posted April 17, 2014 Author Share Posted April 17, 2014 Ok i found it myself here the right code in the OrderOPCController.php /* 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) if ($isVirtualCart = $this->context->cart->isVirtualCart()) { $return = Hook::exec('displayPayment'); } else{ return '<p class="warning">'.sprintf( Tools::displayError('A minimum purchase total of %s is required in order to validate your order.'), Tools::displayPrice($minimalPurchase, $currency) ).'</p>'; } 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