R
R
run1822021-01-24 13:42:11
1C-Bitrix
run182, 2021-01-24 13:42:11

How can I get products that do not have a price filled in?

I'm trying to display all products for which the price 7 is not filled, how to do it right?

$obProducts = Bitrix\Iblock\ElementTable::getList([
      "filter" => [
        "IBLOCK_ID" => 208,
        "prop_PRICE_7.CATALOG_GROUP_ID" => 7,
        "prop_PRICE_2.CATALOG_GROUP_ID" => 2,
        "prop_PRICE_7.PRICE" => false,
        "ID" => 494346
      ],
      "select" => [
        "ID",
        "PRICE_7" => "prop_PRICE_7.PRICE",
        "PRICE_2" => "prop_PRICE_2.PRICE"
      ],
      "runtime" => [
        "prop_PRICE_7" => [
          "data_type" => Bitrix\Catalog\PriceTable::class,
          "reference" => [
            "=this.ID" => "ref.PRODUCT_ID"
          ],
          "join_type" => "inner"
        ],
        "prop_PRICE_2" => [
          "data_type" => Bitrix\Catalog\PriceTable::class,
          "reference" => [
            "=this.ID" => "ref.PRODUCT_ID"
          ],
          "join_type" => "inner"
        ]
      ]
    ]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
run182, 2021-01-25
@run182

I will not give a specific code fragment, but I recommend using CIblockElement::getList along with filtering by price.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question