From 3edb6978de7aa7baabef649c630dd203d7a292b3 Mon Sep 17 00:00:00 2001 From: JoySystem_v Date: Mon, 26 Aug 2024 13:23:52 +0300 Subject: [PATCH] =?utf8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?utf8?q?=D1=8F=20=D1=84=D0=B8=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MarketplaceService.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index f9adf09c..6e95710b 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -39,7 +39,7 @@ class MarketplaceService $result[] = [ 'id' => $product->id, 'name' => $product->name, - 'picture' => self::getProductPictureUrl($product->id), + 'pictures' => self::getProductPictureUrl($product->id), 'price' => self::getProductPrice($product->id), 'oldprice' => self::getProductOldPrice($product->id), 'description' => self::getProductDescription($product->id), @@ -66,9 +66,9 @@ class MarketplaceService $xml->addAttribute('date', date('Y-m-d\TH:i:sP')); $shop = $xml->addChild('shop'); - $shop->addChild('name', 'BestSeller'); - $shop->addChild('company', 'The Best inc.'); - $shop->addChild('url', 'http://best.seller.ru'); + $shop->addChild('name', 'База Цветов 24'); + $shop->addChild('company', 'База Цветов 24'); + $shop->addChild('url', 'https://bazacvetov24.ru'); // Добавление валюты $currencies = $shop->addChild('currencies'); @@ -81,7 +81,7 @@ class MarketplaceService $category = $categories->addChild('category', 'Букеты'); $category->addAttribute('id', '1'); - // Добавление информации о доставке + // Добавление информации о доставке??? $deliveryOptions = $shop->addChild('delivery-options'); $deliveryOption = $deliveryOptions->addChild('option'); $deliveryOption->addAttribute('cost', '200'); @@ -93,7 +93,8 @@ class MarketplaceService $offer = $offers->addChild('offer'); $offer->addAttribute('id', $product['id']); $offer->addChild('name', htmlspecialchars($product['name'])); - $offer->addChild('url', 'http://best.seller.ru/product_page.asp?pid=' . $product['id']); + //TODO добавить url на конкректный букет + $offer->addChild('url', 'https://bazacvetov24.ru/flowers/' . $product['id']); $offer->addChild('price', $product['price']); $offer->addChild('currencyId', 'RUR'); $offer->addChild('categoryId', '1'); @@ -117,10 +118,13 @@ class MarketplaceService } foreach ($product['composition'] as $component) { - $consist = $offer->addChild('param', $component['quantity']); + $consist = $offer->addChild('consist', $component['quantity']); $consist->addAttribute('name', htmlspecialchars($component['name'])); $consist->addAttribute('unit', $component['unit']); } + foreach ($product['pictures'] as $picture) { + $offer->addChild('picture', $picture); + } } return $xml->asXML(); @@ -128,7 +132,7 @@ class MarketplaceService // Приватные статические вспомогательные методы private static function getProductPictureUrl($productId) { - return 'https://files.erp24.ru/pic.jpg'; + return ['https://files.erp24.ru/pic.jpg']; } private static function getProductPrice($productId) { $price = Prices::find() -- 2.39.5