A
A
Anto2017-09-20 20:04:04
1C-Bitrix
Anto, 2017-09-20 20:04:04

How to set up global filtering on two properties?

Good evening!
The infoblock contains the New and Bestseller properties, you need to filter it by these 2 criteria. If the product has a checkbox for one of the properties or both, then output.

<?
  global $arrFilter;
$arrFilter = Array( 
        "LOGIC" => "OR",
 	"!PROPERTY_ATT_NEWPRODUCT" => false,
        "!PROPERTY_ATT_SALELEADER" => false,
);
?>

If you specify without "LOGIC" => "OR", a product is displayed with both properties specified. With this parameter, the entire directory is displayed.
Tell me how to withdraw the goods

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2017-09-20
@ZIROKUL

$arFilter = array(
    "IBLOCK_ID" => $IBLOCK_ID, //поменять на ваш ID ИБ
    array(
        "LOGIC" => "OR",
        "!PROPERTY_ATT_NEWPRODUCT" => false,
        "!PROPERTY_ATT_SALELEADER" => false,
    ),
);

or
$arFilter = array(
    "IBLOCK_ID" => $IBLOCK_ID, //поменять на ваш ID ИБ
    array(
        "LOGIC" => "OR",
        "PROPERTY_ATT_NEWPRODUCT_VALUE" => "Да", //поменять на ваше значение списка
        "PROPERTY_ATT_SALELEADER_VALUE" => "Да", //поменять на ваше значение списка
    ),
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question