From: fomichev Date: Mon, 11 Nov 2024 12:22:38 +0000 (+0300) Subject: Проверка с категории X-Git-Tag: 1.6~13^2~17 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=c2192b45a04f22eae468c0ee970049ea6544f2f6;p=erp24_rep%2Fyii-erp24%2F.git Проверка с категории --- diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index a46145f5..4845c01d 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -228,7 +228,7 @@ class MarketplaceService $products = Products1c::find() ->where(['tip' => 'products']) ->andWhere(['not', ['components' => '']]) - // ->andWhere(['parent_id' => $parents]) + ->andWhere(['parent_id' => $parents]) ->all(); @@ -290,7 +290,7 @@ class MarketplaceService $result[] = [ 'id' => $product->id, 'name' => $properties['displayName'], - 'pictures' => MarketplaceService::getProductImageUrl($product->id), + 'pictures' => [$properties['imageUrl']], 'price' => $price, 'oldprice' => MarketplaceService::getProductOldPrice($product->id), 'description' => MarketplaceService::getProductDescription($product->id), @@ -367,7 +367,7 @@ class MarketplaceService $offer->addChild('price', $product['price']); $offer->addChild('oldPrice', $product['oldprice']); $offer->addChild('currencyId', 'RUB'); - $offer->addChild('categoryId', $product['category_id']); // Здесь нужно указать правильный ID категории для продукта + $offer->addChild('categoryId', $product['category_id']); // Добавление доступности доставки $offer->addChild('delivery', 'true'); @@ -419,7 +419,7 @@ class MarketplaceService ->one(); if (!$product) { - return null; // Вернуть null, если продукт не найден + return null; } return [ @@ -443,8 +443,8 @@ class MarketplaceService if ($mediaRecord && $mediaRecord->file_id) { return 'https://media.dev.erp-flowers.ru/media/view?id=' . $mediaRecord->file_id; } - - return null; // Возвращаем null, если изображение не найдено + return 'https://media.dev.erp-flowers.ru/media/view?id=' . $imageId; + // return null; } private static function getProductLinkByGuid($guid) { return 'https://media.dev.erp-flowers.ru/media/view-card?guid=' . urlencode($guid);