Answer the question
In order to leave comments, you need to log in
How to condition an array?
There is a get request
global $arrFilter;
if($_GET['filter_hit'] == 'Y')
$arrFilter[] = array("PROPERTY_YAVLYAETSI_VALUE"=>"популярным");
if($_GET['filter_new'] == 'Y')
$arrFilter[] = array("PROPERTY_YAVLYAETSI_VALUE"=>"новинкой");
if($_GET['filter_sale'] == 'Y')
$arrFilter[] = array("PROPERTY_YAVLYAETSI_VALUE"=>"акцией");
global $arrFilter;
$arrFilter=array(
"IBLOCK_ID" => "7",array( "LOGIC" => "OR",array("PROPERTY_YAVLYAETSI_VALUE"=="популярным"),array("PROPERTY_YAVLYAETSI_VALUE"=="новинкой"),array("PROPERTY_YAVLYAETSI_VALUE"=>"акцией")),);
Answer the question
In order to leave comments, you need to log in
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;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question