diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 665d03994ec52..8dacd8df8a0cc 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2881,6 +2881,11 @@ public function initShopContext() return; } + // Do not initialize context when the store is already initialized in CLI + if (Tools::isPHPCLI() && $this->context) { + return; + } + // Change shop context ? if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false) { $this->context->cookie->shopContext = Tools::getValue('setShopContext');