Answer the question
In order to leave comments, you need to log in
How to find items with price "from" in property type "Money" - Money?
Elements have property type "Money"
Bitrix infoblocks have property type "Money"
It stores the value in VALUE => "1500|RUB"
That is, numbers, then separator | and then currency
How to select, for example, all items whose price is less than 1000 and the currency is RUB ?
Answer the question
In order to leave comments, you need to log in
It is possible, but terribly inconvenient (non-optimal):
\Bitrix\Main\Loader::IncludeModule('iblock');
$filter = [
'IBLOCK_ID' => '2',
[
'LOGIC' => 'AND',
[
'>PROPERTY_PRICE' => '100',
],
[
'PROPERTY_PRICE' => '%|RUB',
]
]
];
$resElements = \CIblockElement::getList([], $filter, false, false, ['ID','IBLOCK_ID','PROPERTY_PRICE']);
while( $element = $resElements->fetch() )
{
var_dump($element);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question