A
A
Arthur2020-07-17 11:30:34
1C-Bitrix
Arthur, 2020-07-17 11:30:34

From unloading goods come without a price, how to make their price equal to zero and those that have already been added?

Tried like this, but it only works when resaving the product

AddEventHandler( "catalog", "OnProductPriceDelete", array( "CProductEventsHandler", "test" ) );

class CProductEventsHandler
{
    public function test($ProductID, $arExceptionIDs)
    {
        if (empty($arExceptionIDs)) {
            CPrice::Add(array(
                'PRODUCT_ID' => $ProductID,
                'CATALOG_GROUP_ID' => 4,
                'CURRENCY' => 'RUB',
                'PRICE' => 0,
            ));
        }
    }
}

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