// 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
This commit is contained in:
fGaillard
2012-05-24 13:01:35 +00:00
parent 0cea293761
commit 989f3b46c1
+10 -4
View File
@@ -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));