Skip to content

Commit

Permalink
Fix category shop association
Browse files Browse the repository at this point in the history
  • Loading branch information
PululuK committed Aug 30, 2024
1 parent c719b30 commit 48fbec6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions classes/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ public function add($autoDate = true, $nullValues = false)
$this->addPosition($position, $idShop);
}
} else {
foreach (Shop::getShops(true) as $shop) {
$position = (int) Category::getLastPosition((int) $this->id_parent, $shop['id_shop']);
$this->addPosition($position, $shop['id_shop']);
foreach ($this->getShopIdsList() as $idAssociatedShop) {
$position = (int) Category::getLastPosition((int) $this->id_parent, $idAssociatedShop);
$this->addPosition($position, $idAssociatedShop);
}
}

Expand Down Expand Up @@ -286,8 +286,8 @@ public function update($nullValues = false)
$this->addPosition($this->position, (int) $idShop);
}
} else {
foreach (Shop::getShops(true) as $shop) {
$this->addPosition($this->position, $shop['id_shop']);
foreach ($this->getShopIdsList() as $idAssociatedShop) {
$this->addPosition($this->position, $idAssociatedShop);
}
}
}
Expand Down

0 comments on commit 48fbec6

Please sign in to comment.