Answer the question
In order to leave comments, you need to log in
How to make multiple selection by filters (buttons) via get requests?
Hello, I have this code:
global $arrFilter;
$arrFilter = array(
"IBLOCK_ID" => "7",
);
$arPropertyFilter = array(
"LOGIC" => "OR"
);
if($_GET['filter_hit'] == 'Y'){
$arPropertyFilter[] = array("PROPERTY_YAVLYAETSI_VALUE" => "популярным");
}
if($_GET['filter_new'] == 'Y'){
$arPropertyFilter[] = array("PROPERTY_YAVLYAETSI_VALUE" => "новинкой");
}
if($_GET['filter_sale'] == 'Y'){
$arPropertyFilter[] = array("PROPERTY_YAVLYAETSI_VALUE" => "акцией");
}
$arrFilter[] = $arPropertyFilter;
switch ($_GET["filter_hit"]) {
case "new":
$arParams["FILTER_NAME"]= $arrFilter;
break;
case "hit":
$arParams["FILTER_NAME"]= $arrFilter;
break;
case "sale":
$arParams["FILTER_NAME"]= $arrFilter;
break;
}
?>
<?
if ($_GET["filter_new"]=='Y')
{
$href='/catalog';
}
elseif($_GET["filter_new"]!=='')
{
$href='?filter_new=Y';
}
?>
<?
if ($_GET["filter_hit"]=='Y')
{
$href1='/catalog';
}
elseif($_GET["filter_hit"]!=='')
{
$href1='?filter_hit=Y';
}
?>
<?
if ($_GET["filter_sale"]=='Y')
{
$href2='/catalog';
}
elseif($_GET["filter_sale"]!=='')
{
$href2='?filter_sale=Y';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question