Answer the question
In order to leave comments, you need to log in
How to filter infoblock elements in catalog.section?
Hello!
How to filter infoblock elements in catalog.section?
It is necessary to make sure that the elements are not displayed if all three property values are empty (property type is "Number").
tried it in different ways:
$GLOBALS['arrFilterС'] = array(
"!=PROPERTY_SKLAD_1" => '',
"!=PROPERTY_SKLAD_2" => '',
"!=PROPERTY_SKLAD_3" => ''
);
$GLOBALS['arrFilterС'] = array(
array(
"LOGIC" => "OR",
array("!=PROPERTY_SKLAD_1" => ''),
array("!=PROPERTY_SKLAD_2" => ''),
array("!=PROPERTY_SKLAD_3" => ''),
),
);
/*
так же пробовал свойства прописывать так:
PROPERTY_SKLAD_1_VALUE
DISPLAY_PROPERTY_SKLAD_1_VALUE
DISPLAY_PROPERTY_SKLAD_1
так же пробовал в значении использовать '', 0, '0'
перед свойством пробовал писать >
так же вместо $GLOBALS['arrFilterС'] пробовал просто писать $arrFilterС
*/
"FILTER_NAME" => 'arrFilterC',
"USE_FILTER" => 'Y',
Answer the question
In order to leave comments, you need to log in
They like if are not set, then NULL. Try to output var_dump'om in a template of a component and to look at their values.
Before connecting the component, write this:
global $arFilter;
$arFilter = [
"PROPERTY_SKLAD_1" => !NULL,
"PROPERTY_SKLAD_2" => !NULL,
"PROPERTY_SKLAD_3" => !NULL,
]
If the values are numeric then you can do this:
global $arrFilter;
$arrFilter = [
">PROPERTY_BLOG_POST_ID" => 0,
">PROPERTY_BLOG_COMMENTS_CNT" => 0,
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question