Good afternoon. Now I am doing export customization in Yandex.Market. I want to add a new tag in xml type vendor - product brand. Added new BREND property to the information block, but it cannot be output in the xml file. Tell me how to get the information block value here /bitrix/modules/catalog/load/yandex_run.php. Perhaps it is necessary how to connect? Tried to do so

$brand_value=$arResult["DISPLAY_PROPERTIES"]["BRAND"]["VALUE"]; $strTmpOff.= "<vendor>".yandex_text2xml($brand_value, true)."</vendor>\n"; 

Thank.

    1 answer 1

    In the code call the list of items

     $arSelect = Array("ID", "IBLOCK_ID", "NAME", "CODE", ....., "DATE_ACTIVE_FROM","PROPERTY_*"); $arFilter = Array("IBLOCK_ID"=>$ваш_id_инфоблока, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y"); $res = CIBlockElement::GetList( Array("SORT"=>"ASC"), $arFilter, false, Array(), $arSelect ); while($ob = $res->GetNextElement()) { $arFields[] = $ob->GetFields(); $arProps[] = $ob->GetProperties(); } 

    in the $ arSelect array, besides sampling your parameters, there should be "PROPERTY_ *" or "PROPERTY_BRAND"

    And for some reason I never put DISPLAY_PROPERTIES, I just put PROPERTIES

     /*$brand_value=$arResult["PROPERTIES"]["BRAND"]["VALUE"];*/ 

    In the loop should be

     foreach ($arProps as $val) { $strTmpOff.= "<vendor>".$val["BRAND"]["VALUE"]."</vendor>\n"; }