• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
  • Класс: CIBlockCMLExport
  • Вызов: CIBlockCMLExport::ExportProductSet
function ExportProductSet($elementId, $elementXml)
{
	$arSetItems = CCatalogProductSet::getAllSetsByProduct($elementId, CCatalogProductSet::TYPE_GROUP);
	if (is_array($arSetItems) && !empty($arSetItems))
	{
		fwrite($this->fp, "tt<".GetMessage("IBLOCK_XML2_PRODUCT_SETS").">n");
		fwrite($this->fp, "ttt<".GetMessage("IBLOCK_XML2_ID").">".htmlspecialcharsbx($elementXml)."n");
		foreach ($arSetItems as $arOneSet)
		{
			fwrite($this->fp, "ttt<".GetMessage("IBLOCK_XML2_PRODUCT_SET").">n");
			if (is_array($arOneSet["ITEMS"]) && !empty($arOneSet["ITEMS"]))
			{
				foreach ($arOneSet["ITEMS"] as $setItem)
				{
					$xmlId = $this->GetElementXML_ID($this->arIBlock["ID"], $setItem["ITEM_ID"]);
					if ($xmlId !== false)
					{
						fwrite($this->fp, "tttt<".GetMessage("IBLOCK_XML2_PRODUCT_SET_ITEM").">n");
						fwrite($this->fp, "ttttt<".GetMessage("IBLOCK_XML2_VALUE").">".htmlspecialcharsbx($xmlId)."n");
						fwrite($this->fp, "ttttt<".GetMessage("IBLOCK_XML2_AMOUNT").">".intval($setItem["QUANTITY"])."n");
						fwrite($this->fp, "ttttt<".GetMessage("IBLOCK_XML2_SORT").">".intval($setItem["SORT"])."n");
						fwrite($this->fp, "ttttn");
					}
				}
			}
			fwrite($this->fp, "tttn");
		}
		fwrite($this->fp, "ttn");
	}
}