From: fomichev Date: Wed, 23 Oct 2024 08:24:34 +0000 (+0300) Subject: исправления id X-Git-Tag: 1.6~13^2~39 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=efe9c68603bfeca165062a8a92e469e33b330e4a;p=erp24_rep%2Fyii-erp24%2F.git исправления id --- 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']);