• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/ebay/exportoffersku.php
  • Класс: BitrixCatalogEbayExportOfferSKU
  • Вызов: ExportOfferSKU::nextItem
protected function nextItem()
{
	/** @var _CIBElement $obItem */
	if(!$obItem = $this->dbItems->GetNextElement())
		return false;
	$arItem = $obItem->GetFields();

	$arItem['PROPERTIES'] = $obItem->GetProperties($arItem);
	$arItem["CATEGORIES"] = $this->getCategories($arItem["ID"]);
	$arItem["DETAIL_PICTURE_URL"] = $this->getPictureUrl((int)$arItem["DETAIL_PICTURE"]);
	$arItem["PREVIEW_PICTURE_URL"] = $this->getPictureUrl((int)$arItem["PREVIEW_PICTURE"]);
	$arItem['OFFERS'] = array();
	$arItem['SELECT_OFFER_PROPS'] = $this->arSelectOfferProps;

	$strOfferTemplateURL = $this->getOfferTemplateUrl();
	$rsOfferItems = $this->getOffersItemsDb($arItem["ID"]);

	if (!empty($strOfferTemplateURL))
		$rsOfferItems->SetUrlTemplates($strOfferTemplateURL);

	if (YANDEX_SKU_EXPORT_MIN_PRICE == $this->arSKUExport['SKU_EXPORT_COND'])
	{
		$arOfferItem = $this->getMinPriceOffer($rsOfferItems, $arItem);

		if(!empty($arOfferItem))
		{
			$arOfferItem = $this->getItemParams($arOfferItem);
			$arItem['OFFERS'][] = $arOfferItem;
		}
	}
	else
	{
		while ($obOfferItem = $rsOfferItems->GetNextElement())
		{
			$arOfferItem = $obOfferItem->GetFields();
			$arOfferItem["PRICES"] = $this->getPrices($arOfferItem["ID"], $this->arOfferIBlock['LID']);

			if ($arOfferItem["PRICES"]["MIN"] <= 0)
				continue;

			$arOfferItem['PROPERTIES'] = $this->getItemProps($obOfferItem, $arItem);
			$arOfferItem = $this->getItemParams($arOfferItem);
			$arItem['OFFERS'][] = $arOfferItem;
		}
	}

	if(empty($arItem['OFFERS']) && $this->catalogType == CCatalogSku::TYPE_FULL)
	{
		$arItem["QUANTITY"] = $this->getQuantity($arItem["ID"]);
		$arItem["PRICES"] = $this->getPrices($arItem["ID"], $this->arIblock['LID']);
		$arItem["PARAMS"] = $this->getParams($arItem, $this->arIblock);
		$arItem["DETAIL_PAGE_URL"] = $this->getDetailPageUrl($arItem["~DETAIL_PAGE_URL"]);
	}

	return $arItem;
}