From d6e282b61d25cf0496cc95057a2fa0d3cfa036d7 Mon Sep 17 00:00:00 2001 From: vChabot Date: Thu, 2 Feb 2012 17:10:54 +0000 Subject: [PATCH] // update category multishop works fine --- classes/Category.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/classes/Category.php b/classes/Category.php index 3e544491d..091fc84bf 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -193,8 +193,14 @@ class CategoryCore extends ObjectModel // If the parent category was changed, we don't want to have 2 categories with the same position if ($this->getDuplicatePosition()) { - $shops = Shop::getAssoShop(); - foreach ($shops as $shop) + $assos = array(); + if (isset($_POST['checkBoxShopAsso_category'])) + foreach ($_POST['checkBoxShopAsso_category'] as $id_asso_object => $row) + { + foreach ($row as $id_shop => $value) + $assos[] = array('id_object' => (int)$id_asso_object, 'id_shop' => (int)$id_shop); + } + foreach ($assos as $shop) $this->addPosition(Category::getLastPosition((int)$this->id_parent, $shop['id_shop']), $shop['id_shop']); } $this->cleanPositions((int)$this->id_parent);