Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question