V
V
v7sila2018-11-15 14:45:21
1C-Bitrix
v7sila, 2018-11-15 14:45:21

How to filter by price type in bitrix?

How to make a selection of goods whose price with ID 1 is greater than 0, and with ID 2 is equal to 0?

$arSelect = [
  "ID",
  "NAME",
];
$arFilter = [
  "IBLOCK_ID" => 2,
  "ACTIVE"=>"Y",
];

$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement())
{
  $arFields[] = $ob->GetFields();
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2018-11-16
@v7sila

$arFilter = [
    "IBLOCK_ID" => 2,
    "ACTIVE"=>"Y",
    [
        "LOGIC" => "OR",
        ">CATALOG_PRICE_1" => "0",
        "=CATALOG_PRICE_2" => "0",
    ]
];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question