From bf76ea031506cb69fc7ff7a1779536727f80d5f3 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Wed, 29 Aug 2012 12:16:26 +0000 Subject: [PATCH] // Don't update some product attributes in group shop context git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17069 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminProductsController.php | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 5d8baa3a5..6d605b8d3 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1648,36 +1648,39 @@ class AdminProductsControllerCore extends AdminController if ($object->update()) { - if ($this->isTabSubmitted('Shipping')) - $this->addCarriers(); - if ($this->isTabSubmitted('Associations')) - $this->updateAccessories($object); - if ($this->isTabSubmitted('Suppliers')) - $this->processSuppliers(); + if (in_array($this->context->shop->getContext(), array(Shop::CONTEXT_SHOP, Shop::CONTEXT_ALL))) + { + if ($this->isTabSubmitted('Shipping')) + $this->addCarriers(); + if ($this->isTabSubmitted('Associations')) + $this->updateAccessories($object); + if ($this->isTabSubmitted('Suppliers')) + $this->processSuppliers(); + if ($this->isTabSubmitted('Features')) + $this->processFeatures(); + if ($this->isTabSubmitted('Combinations')) + $this->processProductAttribute(); + if ($this->isTabSubmitted('Prices')) + { + $this->processPriceAddition(); + $this->processSpecificPricePriorities(); + $this->object->id_tax_rules_group = (int)Tools::getValue('id_tax_rules_group'); + } + if ($this->isTabSubmitted('Customization')) + $this->processCustomizationConfiguration(); + if ($this->isTabSubmitted('Attachments')) + $this->processAttachments(); + + $this->updatePackItems($object); + $this->updateDownloadProduct($object, 1); + $this->updateTags(Language::getLanguages(false), $object); + + if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'), true)) + $this->errors[] = Tools::displayError('An error occurred while linking object.').' '.$this->table.' '.Tools::displayError('To categories'); + } + if ($this->isTabSubmitted('Warehouses')) $this->processWarehouses(); - if ($this->isTabSubmitted('Features')) - $this->processFeatures(); - if ($this->isTabSubmitted('Combinations')) - $this->processProductAttribute(); - if ($this->isTabSubmitted('Prices')) - { - $this->processPriceAddition(); - $this->processSpecificPricePriorities(); - $this->object->id_tax_rules_group = (int)Tools::getValue('id_tax_rules_group'); - } - if ($this->isTabSubmitted('Customization')) - $this->processCustomizationConfiguration(); - if ($this->isTabSubmitted('Attachments')) - $this->processAttachments(); - - $this->updatePackItems($object); - $this->updateDownloadProduct($object, 1); - $this->updateTags(Language::getLanguages(false), $object); - - if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'), true)) - $this->errors[] = Tools::displayError('An error occurred while linking object.').' '.$this->table.' '.Tools::displayError('To categories'); - if (empty($this->errors)) { Hook::exec('actionProductUpdate', array('product' => $object));