$products = Products1c::find()
->where(['tip' => 'products'])
->andWhere(['not', ['components' => '']])
- // ->andWhere(['parent_id' => $parents])
+ ->andWhere(['parent_id' => $parents])
->all();
$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),
$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');
->one();
if (!$product) {
- return null; // Вернуть null, если продукт не найден
+ return null;
}
return [
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);