// small fix for id_shop and php-cli
This commit is contained in:
1 parent
8d0e28291b
commit
a22138f3c7
1 file changed
+4
-1
@@ -352,7 +352,10 @@ class ShopCore extends ObjectModel
|
|||||||
if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI())
|
if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI())
|
||||||
{
|
{
|
||||||
// If in admin, we can access to the shop without right URL
|
// If in admin, we can access to the shop without right URL
|
||||||
$shop = new Shop((int)Configuration::get('PS_SHOP_DEFAULT'));
|
if (!$id_shop)
|
||||||
|
$id_shop = (int)Configuration::get('PS_SHOP_DEFAULT');
|
||||||
|
|
||||||
|
$shop = new Shop((int)$id_shop);
|
||||||
$shop->physical_uri = preg_replace('#/+#', '/', str_replace('\\', '/', dirname(dirname($_SERVER['SCRIPT_NAME']))).'/');
|
$shop->physical_uri = preg_replace('#/+#', '/', str_replace('\\', '/', dirname(dirname($_SERVER['SCRIPT_NAME']))).'/');
|
||||||
$shop->virtual_uri = '';
|
$shop->virtual_uri = '';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user