From efe9c68603bfeca165062a8a92e469e33b330e4a Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 23 Oct 2024 11:24:34 +0300 Subject: [PATCH] =?utf8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D1=8F=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MarketplaceService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index 2ec27a71..45317e48 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -72,7 +72,7 @@ class MarketplaceService $result = []; - foreach ($products as $product) { + foreach ($products as $index => $product) { $components = json_decode($product->components, true); $composition = []; @@ -88,13 +88,14 @@ class MarketplaceService } $result[] = [ - 'id' => $product->id, + 'id' => "000" . ($index + 1), 'name' => $product->name, 'pictures' => self::getProductPictureUrl($product->id), 'price' => self::getProductPrice($product->id), 'oldprice' => self::getProductOldPrice($product->id), 'description' => self::getProductDescription($product->id), 'qty' => self::getProductQty($product->id), + 'amount' => self::getProductQty($product->id), 'weight' => self::getProductWeight($product->id), 'minorder' => self::getProductMinOrder($product->id), 'composition' => $composition, @@ -134,7 +135,7 @@ class MarketplaceService $categories = $shop->addChild('categories'); $category1 = $categories->addChild('category', 'Букеты'); $category1->addAttribute('id', '1'); - $category2 = $categories->addChild('category', 'Аксессуары'); + $category2 = $categories->addChild('category', 'Цветы'); $category2->addAttribute('id', '2'); // Добавление офферов (продуктов) @@ -163,6 +164,7 @@ class MarketplaceService // Добавление веса и количества $offer->addChild('weight', $product['weight']); $offer->addChild('qty', $product['qty']); + $offer->addChild('amount', $product['amount']); foreach ($product['composition'] as $component) { $consist = $offer->addChild('consist', $component['quantity']); -- 2.39.5