From f2e604a001dd9fa3fbeaaaa3bdb648a0b1764caa Mon Sep 17 00:00:00 2001 From: aNiassy Date: Wed, 13 Jun 2012 08:12:16 +0000 Subject: [PATCH] [-] FO : #PSCFI-5795 : fixed a bug where the opc freeze when an Order is to 0 --- classes/order/OrderDetail.php | 4 ++-- controllers/front/OrderOpcController.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/order/OrderDetail.php b/classes/order/OrderDetail.php index b6a269c5f..4c8b82707 100644 --- a/classes/order/OrderDetail.php +++ b/classes/order/OrderDetail.php @@ -303,10 +303,10 @@ class OrderDetailCore extends ObjectModel if (count($this->tax_calculator->taxes) == 0) return true; - + if ($order->total_products <= 0) return true; - + $ratio = $this->unit_price_tax_excl / $order->total_products; $order_reduction_amount = $order->total_discounts_tax_excl * $ratio; $discounted_price_tax_excl = $this->unit_price_tax_excl - $order_reduction_amount; diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index d167e9fd4..b4c2ab471 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -428,7 +428,6 @@ class OrderOpcControllerCore extends ParentOrderController return '

'.Tools::displayError('Error: no currency has been selected').'

'; if (!$this->context->cookie->checkedTOS && Configuration::get('PS_CONDITIONS')) return '

'.Tools::displayError('Please accept the Terms of Service').'

'; - /* If some products have disappear */ if (!$this->context->cart->checkQuantities()) return '

'.Tools::displayError('An item in your cart is no longer available, you cannot proceed with your order.').'

';