Guest User

Untitled

a guest
Jun 23rd, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. CModule::IncludeModule('highloadblock');
  2. $hlblock_id = 1;
  3. $hlblock = Bitrix\Highloadblock\HighloadBlockTable::getById( $hlblock_id )->fetch();
  4. $entity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity( $hlblock );
  5. $entity_data_class = $entity->getDataClass();
  6. $entity_table_name = $hlblock['TABLE_NAME'];
  7. $sTableID = 'tbl_'.$entity_table_name;
  8.  
  9. $color = array();
  10. $arSelect = Array("ID","IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM");
  11. $arFilter = Array("ID"=>$arResult['ID'],"IBLOCK_ID"=>11,"ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
  12. $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
  13.  
  14. while($ob = $res->GetNextElement())
  15. {
  16. $arProps = $ob->GetProperties();
  17. $color = $arProps["COLOR_CART"]["VALUE"];
  18. }
  19.  
  20. $arFilter = array("UF_XML_ID"=>$color);
  21. $arSelect = array('*');
  22.  
  23. $rsData = $entity_data_class::getList(array(
  24. "select" => $arSelect,
  25. "filter" => $arFilter,
  26. "limit" => '40',
  27. ));
  28.  
  29.  
  30. $rsData = new CDBResult($rsData, $sTableID);
  31. $selected_color = array();
  32. while($arRes = $rsData->Fetch()){
  33. $selected_color[] = $arRes['UF_FILE'];
  34. }
  35.  
  36. foreach ($arResult as $value)
  37. {
  38. $arResult['MOD_COLOR'] = $selected_color;
  39. }
Add Comment
Please, Sign In to add comment