From: JoySystem_v Date: Mon, 26 Aug 2024 10:23:52 +0000 (+0300) Subject: изменения фида X-Git-Tag: 1.6~13^2~49 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=3edb6978de7aa7baabef649c630dd203d7a292b3;p=erp24_rep%2Fyii-erp24%2F.git изменения фида --- 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()