Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CModule::IncludeModule('highloadblock');
- $hlblock_id = 1;
- $hlblock = Bitrix\Highloadblock\HighloadBlockTable::getById( $hlblock_id )->fetch();
- $entity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity( $hlblock );
- $entity_data_class = $entity->getDataClass();
- $entity_table_name = $hlblock['TABLE_NAME'];
- $sTableID = 'tbl_'.$entity_table_name;
- $color = array();
- $arSelect = Array("ID","IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM");
- $arFilter = Array("ID"=>$arResult['ID'],"IBLOCK_ID"=>11,"ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
- $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
- while($ob = $res->GetNextElement())
- {
- $arProps = $ob->GetProperties();
- $color = $arProps["COLOR_CART"]["VALUE"];
- }
- $arFilter = array("UF_XML_ID"=>$color);
- $arSelect = array('*');
- $rsData = $entity_data_class::getList(array(
- "select" => $arSelect,
- "filter" => $arFilter,
- "limit" => '40',
- ));
- $rsData = new CDBResult($rsData, $sTableID);
- $selected_color = array();
- while($arRes = $rsData->Fetch()){
- $selected_color[] = $arRes['UF_FILE'];
- }
- foreach ($arResult as $value)
- {
- $arResult['MOD_COLOR'] = $selected_color;
- }
Add Comment
Please, Sign In to add comment