function OnAfterIBlockElementUpdateHandler(&$arFields) { CModule::IncludeModule('sale'); CModule::IncludeModule("iblock"); CModule::IncludeModule("catalog"); $ar_res = CCatalogProduct::GetByID($arFields['ID']); if($ar_res['QUANTITY']>0){ $arFields = array('QUANTITY_TRACE'=>'N'); CatalogProduct::Update($arFields['ID'], $arFields); }elseif($ar_res['QUANTITY']=0){ $arFields = array('QUANTITY_TRACE'=>'N'); CatalogProduct::Update($arFields['ID'], $arFields); } }
Обсуждают сегодня