- Модуль: catalog
- Путь к файлу: ~/bitrix/modules/catalog/lib/product/sku.php
- Класс: BitrixCatalogProductSku
- Вызов: Sku::calculatePrice
static function calculatePrice($id, $iblockId = null, $type = null, array $priceTypes = [])
{
if (!self::allowedUpdateAvailable())
return;
if (self::isSeparateSkuMode())
return;
$id = (int)$id;
if ($id <= 0)
return;
if (
$type == CatalogProductTable::TYPE_FREE_OFFER
|| $type == CatalogProductTable::TYPE_PRODUCT
|| $type == CatalogProductTable::TYPE_SET
)
return;
if ($iblockId !== null)
{
$iblockId = (int)$iblockId;
if ($iblockId <= 0)
$iblockId = null;
}
switch ($type)
{
case CatalogProductTable::TYPE_SKU:
case CatalogProductTable::TYPE_EMPTY_SKU:
self::setCalculatePriceTypes(self::$deferredSku, $id, $iblockId, $priceTypes);
break;
case CatalogProductTable::TYPE_OFFER:
self::setCalculatePriceTypes(self::$deferredOffers, $id, $iblockId, $priceTypes);
break;
default:
if (isset(self::$deferredSku[$id]))
self::setCalculatePriceTypes(self::$deferredSku, $id, $iblockId, $priceTypes);
elseif (isset(self::$deferredOffers[$id]))
self::setCalculatePriceTypes(self::$deferredOffers, $id, $iblockId, $priceTypes);
else
self::setCalculatePriceTypes(self::$deferredUnknown, $id, $iblockId, $priceTypes);
break;
}
if (!self::usedDeferredCalculation())
self::calculate();
}