1С-Битрикс
1
Вклад в тег
$_REQUEST['show_all'] = "Y";
AddEventHandler("catalog", "OnPriceUpdate", "HandlerOnPriceUpdate");
function HandlerOnPriceUpdate($ID,&$arFields)
{
$element = $arFields['PRODUCT_ID']; //ID товара
$iblockId = 4;
$coeff= 100; //например
$curElementRatio = CCatalogMeasureRatio::getList(
Array(),
array('IBLOCK_ID' => $iblockId, 'PRODUCT_ID' => $element ),
false, false);
while ($arRatio = $curElementRatio->GetNext()) {
$ratioId = $arRatio['ID'];
$arFieldsNew = Array(
'RATIO' => $coeff,
);
CCatalogMeasureRatio::update($ratioId, $arFieldsNew);
}
}