P
P
pantaleone482021-03-19 10:53:07
1C-Bitrix
pantaleone48, 2021-03-19 10:53:07

How to remove a discount from a product via the API?

You need to remove the discount for a specific product. The old kernel has a CCatalogDiscount::Update method, but how do I get the product IDs of this discount? If receive like this

$discounts = CCatalogDiscount::GetDiscountProductsList(
        array(),
        array("DISCOUNT_ID" =>1785),
        false,
        false,
        array()
    );


I get an array
Array
(
    [ID] => 3
    [DISCOUNT_ID] => 1785
    [PRODUCT_ID] => 0
)


At the same time, the discount with this ID has several products with discounts.

There is a \Bitrix\Sale\Discount::setApplyResult method in d7, but nothing is clear with it either) What object should be passed to it? The documentation has only a basket or an order, but I need to delete a specific product

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question