<?php defined('HOSTCMS') || exit('HostCMS: access denied.'); /** * Наблюдатель для подмены цены товара с учетом наценки. */ class Shop_Item_Controller_Observer_AddMarkupToPrice { /** * Подменяет цену товара с учетом наценки. * * @param Shop_Item_Controller $oShopItemController * @param array $aArgs * @return void */ public static function onAfterCalculatePrice(Shop_Item_Controller $oShopItemController, array $aArgs) { $aPrice = $oShopItemController->getAPrice(); list($oShopItem) = $aArgs; if (isset($_SESSION['hostcmsCartMarkups'][$oShopItem->id])) { $markupValue = floatval($_SESSION['hostcmsCartMarkups'][$oShopItem->id]); $aPrice['price'] += $markupValue; $aPrice['price_discount'] += $markupValue; } $oShopItemController->setAPrice($aPrice); } }
Страницу создал Максим Засорин 23.01.17 в 14:45