本文整理匯總了PHP中CCatalogProduct::__CalcOnePriority方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCatalogProduct::__CalcOnePriority方法的具體用法?PHP CCatalogProduct::__CalcOnePriority怎麽用?PHP CCatalogProduct::__CalcOnePriority使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCatalogProduct
的用法示例。
在下文中一共展示了CCatalogProduct::__CalcOnePriority方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CountPriceWithDiscount
//.........這裏部分代碼省略.........
{
$mxResult = true;
foreach (GetModuleEvents("catalog", "OnCountPriceWithDiscount", true) as $arEvent)
{
$mxResult = ExecuteModuleEventEx($arEvent, array($price, $currency, $arDiscounts));
if (true !== $mxResult)
return $mxResult;
}
if (strlen($currency) <= 0)
return false;
$price = doubleval($price);
if ($price <= 0)
return 0.0;
if (!is_array($arDiscounts) || empty($arDiscounts))
return $price;
$arDiscSave = array();
$arPriceDiscount = array();
$arResultPrice = array(
'PRICE' => $price,
'CURRENCY' => $currency,
);
CCatalogProduct::__PrimaryDiscountFilter($arDiscounts, $arPriceDiscount, $arDiscSave, $arResultPrice);
if (!empty($arPriceDiscount))
{
foreach ($arPriceDiscount as &$arOnePriority)
{
$boolResultPriority = CCatalogProduct::__CalcOnePriority($arOnePriority, $arDiscountApply, $arResultPrice);
if (!$boolResultPriority)
{
return $price;
}
else
{
if (isset($arResultPrice['LAST_DISCOUNT']) && 'Y' == $arResultPrice['LAST_DISCOUNT'])
break;
}
}
if (isset($arOnePriority))
unset($arOnePriority);
}
if (!empty($arDiscSave))
{
switch($strDiscSaveApply)
{
case 'R':
$arDiscSaveResult = array(
'PRICE' => $price,
'CURRENCY' => $currency,
);
$arDiscSaveApply = array();
$boolResultDiscSave = CCatalogProduct::__CalcDiscSave($arDiscSave, $arDiscSaveApply, $arDiscSaveResult);
if (!$boolResultDiscSave)
{
return $price;
}
else
{
if ($arDiscSaveResult['PRICE'] < $arResultPrice['PRICE'])