<?
$ELEMENT_SORT_FIELD = $arParams["ELEMENT_SORT_FIELD"];
$ELEMENT_SORT_ORDER = $arParams["ELEMENT_SORT_ORDER"];
$PAGE_ELEMENT_COUNT = $arParams["PAGE_ELEMENT_COUNT"];
if (isset($_GET['by']))
{
if ($_GET['by'] == "price") $ELEMENT_SORT_FIELD = "CATALOG_PRICE_1";
if ($_GET['by'] == "producer") $ELEMENT_SORT_FIELD = "PROPERTY_PRODUCER";
if ($_GET['by'] == "isset") $ELEMENT_SORT_FIELD = "CATALOG_QUANTITY";
}
if (isset($_GET['order']))
{
$ELEMENT_SORT_ORDER = ($_GET['order'] == "desc") ? "desc" : "asc";
}
if (isset($_GET['count']) && in_array($_GET['count'], array(20, 50, 100, "all")))
{
$PAGE_ELEMENT_COUNT = ($_GET['count'] == "all") ? 100000 : $_GET['count'];
}
global $arrFilter;
$arrFiter = array();
if (isset($_GET['producer']) && !empty($_GET['producer']))
{
$arrFilter['PROPERTY_PRODUCER'] = htmlspecialcharsEx($_GET['producer']);
}
if (isset($_GET['series']) && !empty($_GET['series']))
{
$arrFilter['PROPERTY_SERIES'] = htmlspecialcharsEx($_GET['series']);
}
if (isset($_GET['articul']) && !empty($_GET['articul']))
{
$arrFilter['%PROPERTY_ARTICUL'] = htmlspecialcharsEx($_GET['articul']);
}
if (isset($_GET['price_from']) && !empty($_GET['price_from']))
{
$arrFilter['>=CATALOG_PRICE_1'] = intval($_GET['price_from']);
}
if (isset($_GET['price_to']) && !empty($_GET['price_to']))
{
$arrFilter['<=CATALOG_PRICE_1'] = intval($_GET['price_to']);
}
if (isset($_GET['name']) && !empty($_GET['name']))
{
$arrFilter['%NAME'] = htmlspecialcharsEx($_GET['name']);
}
if (isset($_GET['keywords']) && !empty($_GET['keywords']))
{
$arrFilter[] = array("%NAME" => htmlspecialcharsEx($_GET['keywords']), '%DETAIL_TEXT' => htmlspecialcharsEx($_GET['keywords']), "LOGIC"=>"OR");
}
if (isset($_GET['q']) && !empty($_GET['q']))
{
$arrFilter[] = array("%NAME" => htmlspecialcharsEx($_GET['q']), '%DETAIL_TEXT' => htmlspecialcharsEx($_GET['q']),
'%PROPERTY_ARTICUL' => htmlspecialcharsEx($_GET['q']), '%PROPERTY_PRODUCER' => htmlspecialcharsEx($_GET['q']), "LOGIC"=>"OR");
}
if (empty($LIST_BROWSER_TITLE)) $LIST_BROWSER_TITLE = "Результат поиска";
?> |