<?if ($arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]):?>
<div class="article_block">
<div class="muted font_sxs">
<?=GetMessage("SEARCH_ARTICLE")?>
<?= $arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]?>
</div>
</div>
<?endif?>
<?if (!empty($arResult['PROPERTIES']["PROPERTY_CML2_ARTICLE"]['VALUE'])):?>
<div class="article_block">
<div class="muted font_sxs">
<?=GetMessage("SEARCH_ARTICLE")?>
<?= $arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]?>
</div>
</div>
<?endif?>
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$PREVIEW_WIDTH = intval($arParams["PREVIEW_WIDTH"]);
if ($PREVIEW_WIDTH <= 0)
$PREVIEW_WIDTH = 300;
$PREVIEW_HEIGHT = intval($arParams["PREVIEW_HEIGHT"]);
if ($PREVIEW_HEIGHT <= 0)
$PREVIEW_HEIGHT = 300;
foreach($arResult["SEARCH"] as $arItem){
if($arItem["MODULE_ID"] == "iblock" && substr($arItem["ITEM_ID"], 0, 1) !== "S")
{
$arResult["ELEMENTS"][$arItem["ITEM_ID"]] = $arItem["ITEM_ID"];
}
elseif($arItem["MODULE_ID"] == "iblock" && substr($arItem["ITEM_ID"], 0, 1) == "S")
{
$arResult["SECTIONS"][$arItem["ITEM_ID"]] = str_replace('S', '', $arItem["ITEM_ID"]);
}
}
if (!empty($arResult["ELEMENTS"]) && CModule::IncludeModule("iblock"))
{
$arSelect = array(
"ID",
"IBLOCK_ID",
"PREVIEW_TEXT",
"PREVIEW_PICTURE",
"DETAIL_PICTURE",
"PRICE_1",
"QUANTITY",
"STORE_AMOUNT",
"PROPERTY_CML2_ARTICLE",
);
$arFilter = array(
"IBLOCK_LID" => SITE_ID,
"IBLOCK_ACTIVE" => "Y",
"ACTIVE_DATE" => "Y",
"ACTIVE" => "Y",
"CHECK_PERMISSIONS" => "Y",
"MIN_PERMISSION" => "R",
"!QUANTITY" => false,
">QUANTITY" => 0,
);
$arFilter["=ID"] = $arResult["ELEMENTS"];
$arResult["ELEMENTS"] = array();
$arParams["ELEMENT_SORT_FIELD"] = "SORT";
$rsElements = CIBlockElement::GetList(array("QUANTITY"=>"desc"), $arFilter, false, false, $arSelect);
while($arElement = $rsElements->Fetch())
{
$arElement["PROPS"] = array();
if(!empty($arParams["SHOW_PROPS"])){
foreach($arParams["SHOW_PROPS"] as $prop){
$prop = IntVal(trim($prop));
if(!$prop) continue;
$tmp = array();
$vals = array();
$db_props = CIBlockElement::GetProperty($arElement["IBLOCK_ID"], $arElement["ID"], array("sort" => "asc"), Array("ID"=>$prop));
while($ar_props = $db_props->Fetch())
{
$tmp = $ar_props;
if($ar_props["VALUE"])
$vals[] = $ar_props["VALUE"];
}
$tmp["VALUE"] = $vals;
$arElement["PROPS"][] = $tmp;
}
}
$arResult["ELEMENTS"][$arElement["ID"]] = $arElement;
}
}
if (!empty($arResult["SECTIONS"]) && CModule::IncludeModule("iblock"))
{
$arFilter = array(
"IBLOCK_LID" => SITE_ID,
"IBLOCK_ACTIVE" => "Y",
"ACTIVE_DATE" => "Y",
"ACTIVE" => "Y",
"CHECK_PERMISSIONS" => "Y",
"MIN_PERMISSION" => "R",
);
$arFilter["=ID"] = $arResult["SECTIONS"];
$arSelect = array(
"ID",
"IBLOCK_ID",
"PICTURE",
"DESCRIPTION",
);
$db_list = CIBlockSection::GetList(Array($by=>$order), $arFilter, false, $arSelect);
while($ar_result = $db_list->GetNext())
{
$arResult["SECTIONS"]["S".$ar_result["ID"]] = $ar_result;
}
}
foreach($arResult["SEARCH"] as $i=>&$arItem)
{
$arItem["QUANTITY"] = $arResult["ELEMENTS"][$arItem["ITEM_ID"]]["QUANTITY"];
if($arItem["MODULE_ID"] == "iblock" && !empty($arResult["ELEMENTS"][$arItem["ITEM_ID"]]))
{
$arElement = $arResult["ELEMENTS"][$arItem["ITEM_ID"]];
if ($arElement["PREVIEW_PICTURE"] > 0)
$arItem["PICTURE"] = CFile::ResizeImageGet($arElement["PREVIEW_PICTURE"], array("width"=>$PREVIEW_WIDTH, "height"=>$PREVIEW_HEIGHT), BX_RESIZE_IMAGE_PROPORTIONAL, true);
elseif ($arElement["DETAIL_PICTURE"] > 0)
$arItem["PICTURE"] = CFile::ResizeImageGet($arElement["DETAIL_PICTURE"], array("width"=>$PREVIEW_WIDTH, "height"=>$PREVIEW_HEIGHT), BX_RESIZE_IMAGE_PROPORTIONAL, true);
}
elseif($arItem["MODULE_ID"] == "iblock" && !empty($arResult["SECTIONS"][$arItem["ITEM_ID"]]))
{
$arElement = $arResult["SECTIONS"][$arItem["ITEM_ID"]];
if ($arElement["PICTURE"] > 0)
$arItem["PICTURE"] = CFile::ResizeImageGet($arElement["PICTURE"], array("width"=>$PREVIEW_WIDTH, "height"=>$PREVIEW_HEIGHT), BX_RESIZE_IMAGE_PROPORTIONAL, true);
}
}
unset($arItem);
<?
echo '<pre>';
var_dump/print_r($arResult['PROPERTIES']['CML2_ARTICLE']['VALUE']);
echo '</pre>';
?>
<?
echo '<pre>';
var_dump/print_r($arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]);
echo '</pre>';
?>