From 989f3b46c1bc861ab6ecd911d30dd3dd94fc5d2b Mon Sep 17 00:00:00 2001 From: fGaillard Date: Thu, 24 May 2012 13:01:35 +0000 Subject: [PATCH] // Bug fix for payment modules (shops informations on validate order) git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15660 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/PaymentModule.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 5fa4c4400..85e011067 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -143,8 +143,6 @@ abstract class PaymentModuleCore extends Module $cart = new Cart($id_cart); $this->context->cart = $cart; - if (!$shop) - $shop = Context::getContext()->shop; if (!$this->active) die(Tools::displayError()); // Does order already exists ? @@ -221,8 +219,16 @@ abstract class PaymentModuleCore extends Module $order->id_cart = (int)$cart->id; $order->reference = $reference; - $order->id_shop = (int)(Shop::getContext() == Shop::CONTEXT_SHOP ? $shop->id : $cart->id_shop); - $order->id_shop_group = (int)(Shop::getContext() == Shop::CONTEXT_SHOP ? $shop->id_shop_group : $cart->id_shop_group); + if (($shop != null) || (Shop::getContext() == Shop::CONTEXT_SHOP)) + { + $order->id_shop = (int)$shop->id; + $order->id_shop_group = (int)$shop->id_shop_group; + } + else + { + $order->id_shop = $cart->id_shop; + $order->id_shop_group = $cart->id_shop_group; + } $customer = new Customer($order->id_customer); $order->secure_key = ($secure_key ? pSQL($secure_key) : pSQL($customer->secure_key));