A
A
Anumik2016-08-13 13:54:43
1C-Bitrix
Anumik, 2016-08-13 13:54:43

How to set the property binding to elements in the filter?

Good day!
How to set a filter for a component by property binding to an element?
Printed the arResult array, found the [CITY] array in it with the desired [VALUE] property, tried to write it like this:

$arrFilter = array("PROPERTY_CITY_VALUE"=>$userCityCode);

but apparently something is wrong.
Filter in component settings enabled

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Savrasov, 2016-08-13
@Anumik

1. Specify the name of the filter in the component parameters. For example "arrFilter"
2. Write above the component

$GLOBALS["arrFilter"] = array();
$GLOBALS["arrFilter"]["PROPERTY_CITY"] = ИД_ЭЛЕМЕНТА;

Mustache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question