From 2b9410c4260c77d56b638e09a5c0f5bd2f86d155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gaillard?= Date: Thu, 24 May 2012 13:01:35 +0000 Subject: [PATCH] // Bug fix for payment modules (shops informations on validate order) --- 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));