diff --git a/admin-dev/index.php b/admin-dev/index.php index 323fe58da..017cf08c4 100644 --- a/admin-dev/index.php +++ b/admin-dev/index.php @@ -78,18 +78,12 @@ if (empty($tab) and !sizeof($_POST)) { echo ' '.translate('You are currently view/configure your store for').' '; - if (Shop::getContextType() == Shop::CONTEXT_ALL) + if (Context::getContext()->shop->getContextType() == Shop::CONTEXT_ALL) echo 'all shops'; - elseif (Shop::getContextType() == Shop::CONTEXT_GROUP) - { - $group_shop = new GroupShop((int)Shop::getCurrentGroupShop()); - echo 'all shops of group shop '.$group_shop->name.''; - } - elseif (Shop::getContextType() == Shop::CONTEXT_SHOP) - { - $shop = new Shop((int)Shop::getCurrentShop()); - echo 'shop '.$shop->name.''; - } + elseif (Context::getContext()->shop->getContextType() == Shop::CONTEXT_GROUP) + echo 'all shops of group shop '.Context::getContext()->shop->getGroup()->name.''; + elseif (Context::getContext()->shop->getContextType() == Shop::CONTEXT_SHOP) + echo 'shop '.Context::getContext()->shop->name.''; echo '  '; } diff --git a/admin-dev/tabs/AdminCatalog.php b/admin-dev/tabs/AdminCatalog.php index b52508e10..6fb690cfb 100644 --- a/admin-dev/tabs/AdminCatalog.php +++ b/admin-dev/tabs/AdminCatalog.php @@ -176,7 +176,7 @@ class AdminCatalog extends AdminTab if (!$id_category) { $home = true; - $id_category = Context::getContext()->shop->id_category1; + $id_category = Context::getContext()->shop->id_category; } $catalog_tabs = array('category', 'product'); // Cleaning links diff --git a/admin-dev/tabs/AdminCategories.php b/admin-dev/tabs/AdminCategories.php index 9da265d9e..17fb64e7e 100644 --- a/admin-dev/tabs/AdminCategories.php +++ b/admin-dev/tabs/AdminCategories.php @@ -220,11 +220,8 @@ class AdminCategories extends AdminTab return; $active = $this->getFieldValue($obj, 'active'); $customer_groups = $obj->getGroups(); - if (Shop::getContextType() == Shop::CONTEXT_SHOP) - { - $shop = new Shop(Shop::getCurrentShop()); - $id_category = $shop->id_category; - } + if ($context->shop->getContextType() == Shop::CONTEXT_SHOP) + $id_category = $context->shop->id_category; else $id_category = (int)Tools::getValue('id_parent'); diff --git a/admin-dev/tabs/AdminImport.php b/admin-dev/tabs/AdminImport.php index ad1300473..c1d967647 100644 --- a/admin-dev/tabs/AdminImport.php +++ b/admin-dev/tabs/AdminImport.php @@ -589,7 +589,6 @@ class AdminImport extends AdminTab public function productImport() { - global $cookie; $this->receiveTab(); $handle = $this->openCsvFile(); $defaultLanguageId = (int)(Configuration::get('PS_LANG_DEFAULT')); @@ -788,7 +787,8 @@ class AdminImport extends AdminTab { $specificPrice = new SpecificPrice(); $specificPrice->id_product = (int)($product->id); - $specificPrice->id_shop = (int)(Shop::getCurrentShop()); + // @todo multishop specific price import + $specificPrice->id_shop = $context->shop->getID(); $specificPrice->id_currency = 0; $specificPrice->id_country = 0; $specificPrice->id_group = 0; @@ -849,7 +849,7 @@ class AdminImport extends AdminTab if (isset($product->image) AND is_array($product->image) and sizeof($product->image)) { - $productHasImages = (bool)Image::getImages((int)($cookie->id_lang), (int)($product->id)); + $productHasImages = (bool)Image::getImages($context->language->id, (int)($product->id)); foreach ($product->image AS $key => $url) if (!empty($url)) { @@ -1239,9 +1239,9 @@ class AdminImport extends AdminTab public function displayForm($isMainTab = true) { - global $currentIndex, $cookie; parent::displayForm(); + $context = Context::getContext(); if ((Tools::getValue('import')) AND (isset($this->_warnings) AND !sizeof($this->_warnings))) echo '
'.$this->l('The .CSV file has been imported into your shop.').'
'; @@ -1270,7 +1270,7 @@ class AdminImport extends AdminTab echo '
'.$this->l('Upload').' -
+

'.$this->l('You can also upload your file by FTP and put it in').' '.realpath(dirname(__FILE__).'/../import/').'. @@ -1295,7 +1295,7 @@ class AdminImport extends AdminTab { echo '
- +
'.$this->l('Import').' @@ -1321,7 +1321,7 @@ class AdminImport extends AdminTab
@@ -1360,7 +1360,7 @@ class AdminImport extends AdminTab