本文整理汇总了PHP中CSaleOrder::getRoundFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::getRoundFields方法的具体用法?PHP CSaleOrder::getRoundFields怎么用?PHP CSaleOrder::getRoundFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::getRoundFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBasketItems
//.........这里部分代码省略.........
}
$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;
$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"]);
$arOptions = array('COUNT_DISCOUNT_4_ALL_QUANTITY' => $this->countDiscount4AllQuantity);
$arErrors = array();
CSaleDiscount::DoProcessOrder($arOrder, $arOptions, $arErrors);
if (isset($arOrder['ORDER_PRICE'])) {
$roundOrderFields = CSaleOrder::getRoundFields();
foreach ($arOrder as $fieldName => $fieldValue) {
if (in_array($fieldName, $roundOrderFields)) {
$arOrder[$fieldName] = roundEx($arOrder[$fieldName], SALE_VALUE_PRECISION);
}
}
}
if (!empty($arOrder['BASKET_ITEMS']) && is_array($arOrder['BASKET_ITEMS'])) {
$arOrder['ORDER_PRICE'] = 0;
$roundBasketFields = CSaleBasket::getRoundFields();
foreach ($arOrder['BASKET_ITEMS'] as &$basketItem) {
foreach ($basketItem as $fieldName => $fieldValue) {
if (in_array($fieldName, $roundBasketFields)) {
if (isset($basketItem[$fieldName])) {
$basketItem[$fieldName] = roundEx($basketItem[$fieldName], SALE_VALUE_PRECISION);
}
}
}
$arOrder['ORDER_PRICE'] += $basketItem['PRICE'] * $basketItem['QUANTITY'];
}
$arOrder['ORDER_PRICE'] = roundEx($arOrder['ORDER_PRICE'], SALE_VALUE_PRECISION);
}
$allSum = 0;
$allWeight = 0;
$allVATSum = 0;
$DISCOUNT_PRICE_ALL = 0;
$priceWithoutDiscount = 0;
foreach ($arOrder["BASKET_ITEMS"] as &$arOneItem) {
$allWeight += $arOneItem["WEIGHT"] * $arOneItem["QUANTITY"];
$allSum += $arOneItem["PRICE"] * $arOneItem["QUANTITY"];
if (array_key_exists('VAT_VALUE', $arOneItem)) {
$arOneItem["PRICE_VAT_VALUE"] = $arOneItem["VAT_VALUE"];
}