// update category multishop works fine

This commit is contained in:
vChabot
2012-02-02 17:10:54 +00:00
parent 94479c6398
commit d6e282b61d
+8 -2
View File
@@ -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);