diff --git a/classes/shop/Shop.php b/classes/shop/Shop.php index 0b09fa31d..068b47101 100644 --- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -352,7 +352,7 @@ class ShopCore extends ObjectModel if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI()) { // If in admin, we can access to the shop without right URL - if (!$id_shop) + if ((!$id_shop && Tools::isPHPCLI()) || defined('_PS_ADMIN_DIR_')) $id_shop = (int)Configuration::get('PS_SHOP_DEFAULT'); $shop = new Shop((int)$id_shop); @@ -1133,4 +1133,4 @@ class ShopCore extends ObjectModel ($delete ? ' AND entity.deleted = 0' : '') ); } -} \ No newline at end of file +}