// update category multishop works fine

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12942 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot committed 2012-02-02 17:10:54 +00:00
1 parent b3295892a7
commit 182a7ba786
1 file changed
+8 -2
+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 the parent category was changed, we don't want to have 2 categories with the same position
if ($this->getDuplicatePosition()) if ($this->getDuplicatePosition())
{ {
$shops = Shop::getAssoShop(); $assos = array();
foreach ($shops as $shop) 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->addPosition(Category::getLastPosition((int)$this->id_parent, $shop['id_shop']), $shop['id_shop']);
} }
$this->cleanPositions((int)$this->id_parent); $this->cleanPositions((int)$this->id_parent);