]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
исправления id
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 23 Oct 2024 08:24:34 +0000 (11:24 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 23 Oct 2024 08:24:34 +0000 (11:24 +0300)
erp24/services/MarketplaceService.php

index 2ec27a7103df78dbe6d670e857d1f9612d0fdbd6..45317e485eee824e7d9cee6f4e78083fd0d352f7 100644 (file)
@@ -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', 'Ð\90кÑ\81еÑ\81Ñ\81Ñ\83аÑ\80ы');
+        $category2 = $categories->addChild('category', 'ЦвеÑ\82ы');
         $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']);