本文整理汇总了PHP中CSaleBasketHelper::formatQuantity方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleBasketHelper::formatQuantity方法的具体用法?PHP CSaleBasketHelper::formatQuantity怎么用?PHP CSaleBasketHelper::formatQuantity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleBasketHelper
的用法示例。
在下文中一共展示了CSaleBasketHelper::formatQuantity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBasketItems
//.........这里部分代码省略.........
$arFileTmp = CFile::ResizeImageGet($arImage, array("width" => "110", "height" => "110"), BX_RESIZE_IMAGE_PROPORTIONAL, true);
$arItem["DETAIL_PICTURE_SRC"] = $arFileTmp["src"];
}
}
}
unset($arItem);
// get sku props data
if (!empty($arBasketItems) && self::$catalogIncluded && isset($this->offersProps) && !empty($this->offersProps)) {
$arBasketItems = $this->getSkuPropsData($arBasketItems, $arParents, $this->offersProps);
}
// count weight for set parent products
foreach ($arBasketItems as &$arItem) {
if (CSaleBasketHelper::isSetParent($arItem)) {
$arItem["WEIGHT"] = $arSetParentWeight[$arItem["ID"]] / $arItem["QUANTITY"];
$arItem["WEIGHT_FORMATED"] = roundEx(doubleval($arItem["WEIGHT"] / $this->weightKoef), SALE_WEIGHT_PRECISION) . " " . $this->weightUnit;
}
}
if (isset($arItem)) {
unset($arItem);
}
// fill item arrays for old templates
foreach ($arBasketItems as &$arItem) {
if (CSaleBasketHelper::isSetItem($arItem)) {
continue;
}
$arItem['DISCOUNT_PRICE'] = (double) $arItem['DISCOUNT_PRICE'];
$arItem['PRICE'] = (double) $arItem['PRICE'];
$arItem['DISCOUNT_PRICE_PERCENT'] = 0;
$arItem['DISCOUNT_PRICE_PERCENT_FORMATED'] = '';
$arItem['FULL_PRICE'] = $arItem['PRICE'];
if ($arItem['DISCOUNT_PRICE'] > 0) {
if ($arItem['DISCOUNT_PRICE'] + $arItem['PRICE'] > 0) {
$arItem['DISCOUNT_PRICE_PERCENT'] = $arItem['DISCOUNT_PRICE'] * 100 / ($arItem['DISCOUNT_PRICE'] + $arItem['PRICE']);
$arItem['DISCOUNT_PRICE_PERCENT_FORMATED'] = CSaleBasketHelper::formatQuantity($arItem['DISCOUNT_PRICE_PERCENT']) . '%';
$arItem['FULL_PRICE'] = $arItem["PRICE"] + $arItem["DISCOUNT_PRICE"];
}
}
$arItem['FULL_PRICE_FORMATED'] = CCurrencyLang::CurrencyFormat($arItem['FULL_PRICE'], $arItem['CURRENCY'], true);
if ($arItem["CAN_BUY"] == "Y" && $arItem["DELAY"] == "N") {
$allSum += $arItem["PRICE"] * $arItem["QUANTITY"];
$allWeight += $arItem["WEIGHT"] * $arItem["QUANTITY"];
$allVATSum += roundEx($arItem["PRICE_VAT_VALUE"] * $arItem["QUANTITY"], SALE_VALUE_PRECISION);
$bShowReady = true;
if ($arItem["DISCOUNT_PRICE"] > 0) {
$DISCOUNT_PRICE_ALL += $arItem["DISCOUNT_PRICE"] * $arItem["QUANTITY"];
}
$arResult["ITEMS"]["AnDelCanBuy"][] = $arItem;
} elseif ($arItem["CAN_BUY"] == "Y" && $arItem["DELAY"] == "Y") {
$bShowDelay = true;
$arItem["SUM"] = CCurrencyLang::CurrencyFormat($arItem["PRICE"] * $arItem["QUANTITY"], $arItem["CURRENCY"], true);
$arResult["ITEMS"]["DelDelCanBuy"][] = $arItem;
} elseif ($arItem["CAN_BUY"] == "N" && $arItem["SUBSCRIBE"] == "Y") {
$bShowSubscribe = true;
$arResult["ITEMS"]["ProdSubscribe"][] = $arItem;
} else {
$bShowNotAvail = true;
$arItem["NOT_AVAILABLE"] = true;
$arResult["ITEMS"]["nAnCanBuy"][] = $arItem;
}
}
unset($arItem);
$arResult["ShowReady"] = $bShowReady ? "Y" : "N";
$arResult["ShowDelay"] = $bShowDelay ? "Y" : "N";
$arResult["ShowNotAvail"] = $bShowNotAvail ? "Y" : "N";
$arResult["ShowSubscribe"] = $bShowSubscribe ? "Y" : "N";
$arOrder = array('SITE_ID' => SITE_ID, 'USER_ID' => $GLOBALS["USER"]->GetID(), 'ORDER_PRICE' => $allSum, 'ORDER_WEIGHT' => $allWeight, 'BASKET_ITEMS' => $arResult["ITEMS"]["AnDelCanBuy"]);