data: "PAGEN_1=" + ajaxPageCounter + "&SORT=" + aSort + "&IBID=" + aIbId + PSID,
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
if(CModule::IncludeModule("iblock") && CModule::IncludeModule("sale")){
if($_POST["PAGEN_1"]){
$_POST["SID"] = explode("|", $_POST["SID"]);
$_POST["SORT"] = explode("|", $_POST["SORT"]);
$arSort = array($_POST["SORT"][0] => $_POST["SORT"][1]);
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DETAIL_PAGE_URL", "PREVIEW_PICTURE", "IBLOCK_SECTION_ID", "CATALOG_GROUP_1", "CATALOG_GROUP_3", "PROPERTY_*");
$arFilter = Array("IBLOCK_ID" => $_POST["IBID"], "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "INCLUDE_SUBSECTIONS" => "Y");
if(isset($_POST["SID"])){
$arFilter["SECTION_ID"] = $_POST["SID"];
unset($arFilter["PROPERTY_BRAND"]);
unset($arFilter[">=DATE_CREATE"]);
}
if(isset($_POST["BID"])){
$arFilter["PROPERTY_BRAND"] = $_POST["BID"];
unset($arFilter["SECTION_ID"]);
unset($arFilter[">=DATE_CREATE"]);
}
if(isset($_POST["PT"])){
$arFilter[">=DATE_CREATE"] = ConvertTimeStamp(time()-(86400*$_POST["PT"]))." 00:00:00";
unset($arFilter["SECTION_ID"]);
unset($arFilter["PROPERTY_BRAND"]);
}
//echo "<pre>"; print_r($arFilter); echo "</pre>";
$res = CIBlockElement::GetList($arSort, $arFilter, false, array('nPageSize' => 6, "iNumPage" => $_POST["PAGEN_1"]), $arSelect);
if($res->SelectedRowsCount()){
//echo $_POST["PAGEN_1"];
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
$arProps = $ob->GetProperties();
$resBrand = CIBlockElement::GetByID($arProps["BRAND"]["VALUE"]);
if($ar_res = $resBrand->GetNext()){
$brand = $ar_res['NAME'];
}
$razdel = CIBlockElement::GetElementGroups($arFields["ID"]);
if($arEl = $razdel->GetNext()){
$rsPath = GetIBlockSectionPath($arEl["IBLOCK_ID"], $arEl["ID"]);
while($arPath=$rsPath->GetNext()) {
if($arPath["DEPTH_LEVEL"] == 1){
$arFields["DETAIL_PAGE_URL"] = str_replace("/" . $arFields["IBLOCK_TYPE_ID"], "", $arFields["DETAIL_PAGE_URL"]);
$href = "/m/" . $arFields["IBLOCK_TYPE_ID"] . "/" . $arPath["CODE"] . $arFields["DETAIL_PAGE_URL"];
}
}
}
$file = CFile::ResizeImageGet($arFields['PREVIEW_PICTURE'], array('width'=>200, 'height'=>200), BX_RESIZE_IMAGE_PROPORTIONAL, true);?>
<div style="display: inline-block; width: 48%; text-align: center; vertical-align: top;/* padding: 5px 1%;*/">
<a href="<?=$href?>">
<div><img style="width: 100%;" src="<?=$file["src"];?>"></div>
<div style="margin: 5px 0 0 0; font-size: 35px;">
<b><?=$brand;?></b>
</div>
<div style="font-size: 20px;">
<?=$arFields["NAME"];?>
</div>
<div style="font-size: 20px;">
Цена: <?=$arFields["CATALOG_PRICE_1"];?> руб.
</div>
</a>
</div>
<?//echo "<pre>"; print_r($arFields); echo "</pre>";
}
}
}
}?>