From 49e04102ae3821e647489ee3aa6e3e37008decbb Mon Sep 17 00:00:00 2001 From: aFolletete Date: Fri, 23 Mar 2012 11:05:55 +0000 Subject: [PATCH] // clean useless code git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14240 b9a71923-0436-4b27-9f14-aed3839534dd --- modules/bankwire/controllers/front/validation.php | 2 +- modules/bankwire/validation.php | 4 +++- modules/cheque/controllers/front/validation.php | 2 +- modules/cheque/validation.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/bankwire/controllers/front/validation.php b/modules/bankwire/controllers/front/validation.php index f85e97027..93636ea59 100644 --- a/modules/bankwire/controllers/front/validation.php +++ b/modules/bankwire/controllers/front/validation.php @@ -54,7 +54,7 @@ class BankwireValidationModuleFrontController extends ModuleFrontController if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); - $currency = Tools::getValue('currency_payement', false) ? new Currency(Tools::getValue('currency_payement')) : Context::getContext()->currency; + $currency = $this->context->currency; $total = (float)$cart->getOrderTotal(true, Cart::BOTH); $mailVars = array( '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), diff --git a/modules/bankwire/validation.php b/modules/bankwire/validation.php index 70949e7cf..650baf9ce 100644 --- a/modules/bankwire/validation.php +++ b/modules/bankwire/validation.php @@ -33,6 +33,8 @@ include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../header.php'); include(dirname(__FILE__).'/bankwire.php'); +$context = Context::getContext(); +$cart = $context->cart; $bankwire = new BankWire(); if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$bankwire->active) @@ -54,7 +56,7 @@ $customer = new Customer((int)$cart->id_customer); if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); -$currency = Tools::getValue('currency_payement', false) ? new Currency(Tools::getValue('currency_payement')) : Context::getContext()->currency; +$currency = $context->currency; $total = (float)($cart->getOrderTotal(true, Cart::BOTH)); $mailVars = array( '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), diff --git a/modules/cheque/controllers/front/validation.php b/modules/cheque/controllers/front/validation.php index 82b047e3f..66bc6f6c4 100644 --- a/modules/cheque/controllers/front/validation.php +++ b/modules/cheque/controllers/front/validation.php @@ -54,7 +54,7 @@ class ChequeValidationModuleFrontController extends ModuleFrontController if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); - $currency = Tools::isSubmit('currency_payement') ? new Currency(Tools::getValue('currency_payement')) : $this->context->currency; + $currency = $this->context->currency; $total = (float)$cart->getOrderTotal(true, Cart::BOTH); $mailVars = array( diff --git a/modules/cheque/validation.php b/modules/cheque/validation.php index 88145d777..dbcc54efc 100644 --- a/modules/cheque/validation.php +++ b/modules/cheque/validation.php @@ -58,7 +58,7 @@ $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); -$currency = Tools::isSubmit('currency_payement') ? new Currency(Tools::getValue('currency_payement')) : $context->currency; +$currency = $context->currency; $total = (float)$cart->getOrderTotal(true, Cart::BOTH); $mailVars = array(