From 0f3f1cb2939a4c2037546fbf010477f2bf0a5ddf Mon Sep 17 00:00:00 2001 From: aKorczak Date: Mon, 27 Aug 2012 15:27:18 +0000 Subject: [PATCH] [-] WS : Fix id_shop behavior when use WS or script --- classes/shop/Shop.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/shop/Shop.php b/classes/shop/Shop.php index c42703d14..956d554e8 100644 --- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -295,10 +295,6 @@ class ShopCore extends ObjectModel */ public static function initialize() { - // Optimization - don't redirect and allow WS and other script to work - if (!($id_shop = Tools::getValue('id_shop'))) - $_GET['id_shop'] = Configuration::get('PS_SHOP_DEFAULT'); - // Find current shop from URL if (!($id_shop = Tools::getValue('id_shop')) || defined('_PS_ADMIN_DIR_')) { @@ -331,6 +327,10 @@ class ShopCore extends ObjectModel } } + // Optimization - don't redirect and allow WS and other script to work + if (!$id_shop) + $id_shop = Configuration::get('PS_SHOP_DEFAULT'); + // If an URL was found but is not the main URL, redirect to main URL if ($id_shop && !$is_main_uri) {