From 48fbec6a81c5343f08a29c264233cafe28b53468 Mon Sep 17 00:00:00 2001 From: PululuK Date: Fri, 30 Aug 2024 11:45:14 +0200 Subject: [PATCH] Fix category shop association --- classes/Category.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/Category.php b/classes/Category.php index be13321a56c15..9cae712527c2f 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -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); } } @@ -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); } } }