當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCurrencyLang類代碼示例

本文整理匯總了PHP中CCurrencyLang的典型用法代碼示例。如果您正苦於以下問題:PHP CCurrencyLang類的具體用法?PHP CCurrencyLang怎麽用?PHP CCurrencyLang使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CCurrencyLang類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CurrencyFormatNumber

function CurrencyFormatNumber($price, $currency)
{
    $arCurFormat = CCurrencyLang::GetCurrencyFormat($currency);
    if (!isset($arCurFormat["DECIMALS"])) {
        $arCurFormat["DECIMALS"] = 2;
    }
    $arCurFormat["DECIMALS"] = IntVal($arCurFormat["DECIMALS"]);
    if (!isset($arCurFormat["DEC_POINT"])) {
        $arCurFormat["DEC_POINT"] = ".";
    }
    if (!empty($arCurFormat["THOUSANDS_VARIANT"])) {
        if ($arCurFormat["THOUSANDS_VARIANT"] == "N") {
            $arCurFormat["THOUSANDS_SEP"] = "";
        } elseif ($arCurFormat["THOUSANDS_VARIANT"] == "D") {
            $arCurFormat["THOUSANDS_SEP"] = ".";
        } elseif ($arCurFormat["THOUSANDS_VARIANT"] == "C") {
            $arCurFormat["THOUSANDS_SEP"] = ",";
        } elseif ($arCurFormat["THOUSANDS_VARIANT"] == "S") {
            $arCurFormat["THOUSANDS_SEP"] = chr(32);
        } elseif ($arCurFormat["THOUSANDS_VARIANT"] == "B") {
            $arCurFormat["THOUSANDS_SEP"] = chr(32);
        }
    }
    if (!isset($arCurFormat["FORMAT_STRING"])) {
        $arCurFormat["FORMAT_STRING"] = "#";
    }
    $price = number_format($price, $arCurFormat["DECIMALS"], $arCurFormat["DEC_POINT"], $arCurFormat["THOUSANDS_SEP"]);
    if ($arCurFormat["THOUSANDS_VARIANT"] == "B") {
        $num = str_replace(" ", " ", $num);
    }
    $price = str_replace(',', '.', $price);
    return $price;
}
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:33,代碼來源:include.php

示例2: formatToBaseCurrency

 public static function formatToBaseCurrency($value, $format = null)
 {
     static $module, $baseCurrency;
     if (!$module) {
         $module = Loader::includeModule('currency');
         $baseCurrency = Config::getBaseCurrency();
     }
     if ($module) {
         $value = \CCurrencyLang::CurrencyFormat($value, $baseCurrency);
     }
     return $value;
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:12,代碼來源:utils.php

示例3: loadFromDatabase

 /**
  * Loads values from database.
  * Returns true on success.
  *
  * @return boolean
  */
 protected function loadFromDatabase()
 {
     if (!isset($this->fields)) {
         $pricesList = \CPrice::getListEx(array(), array("=PRODUCT_ID" => $this->id, "+<=QUANTITY_FROM" => 1, "+>=QUANTITY_TO" => 1), false, false, array("PRICE", "CURRENCY", "CATALOG_GROUP_ID", "CATALOG_GROUP_CODE"));
         $this->fields = array();
         while ($priceInfo = $pricesList->fetch()) {
             $priceId = $priceInfo["CATALOG_GROUP_ID"];
             $price = \CCurrencyLang::currencyFormat($priceInfo["PRICE"], $priceInfo["CURRENCY"], true);
             $this->addField($priceId, $priceId, $price);
             $this->addField($priceInfo["CATALOG_GROUP_CODE"], $priceId, $price);
         }
     }
     return is_array($this->fields);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:20,代碼來源:elementprice.php

示例4: SaleFormatCurrency

function SaleFormatCurrency($fSum, $strCurrency, $OnlyValue = false, $withoutFormat = false)
{
    if ($withoutFormat === true) {
        if ($fSum === '') {
            return '';
        }
        $currencyFormat = CCurrencyLang::GetFormatDescription($strCurrency);
        if ($currencyFormat === false) {
            $currencyFormat = CCurrencyLang::GetDefaultValues();
        }
        $intDecimals = $currencyFormat['DECIMALS'];
        if (round($fSum, $currencyFormat["DECIMALS"]) == round($fSum, 0)) {
            $intDecimals = 0;
        }
        return number_format($fSum, $intDecimals, '.', '');
    }
    return CCurrencyLang::CurrencyFormat($fSum, $strCurrency, !($OnlyValue === true));
}
開發者ID:akniyev,項目名稱:itprom_dobrohost,代碼行數:18,代碼來源:include.php

示例5: GetCurrencyFormat

 function GetCurrencyFormat($currency, $lang = LANGUAGE_ID)
 {
     global $DB;
     global $stackCacheManager;
     if (defined("CURRENCY_SKIP_CACHE") && CURRENCY_SKIP_CACHE) {
         $arCurrencyLang = CCurrencyLang::GetByID($currency, $lang);
     } else {
         $cacheTime = CURRENCY_CACHE_DEFAULT_TIME;
         if (defined("CURRENCY_CACHE_TIME")) {
             $cacheTime = intval(CURRENCY_CACHE_TIME);
         }
         $strCacheKey = $currency . "_" . $lang;
         $stackCacheManager->SetLength("currency_currency_lang", 20);
         $stackCacheManager->SetTTL("currency_currency_lang", $cacheTime);
         if ($stackCacheManager->Exist("currency_currency_lang", $strCacheKey)) {
             $arCurrencyLang = $stackCacheManager->Get("currency_currency_lang", $strCacheKey);
         } else {
             $arCurrencyLang = CCurrencyLang::GetByID($currency, $lang);
             $stackCacheManager->Set("currency_currency_lang", $strCacheKey, $arCurrencyLang);
         }
     }
     return $arCurrencyLang;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:23,代碼來源:currency_lang.php

示例6: getScripts

    /**
     * @param Order $order
     * @param $formId
     * @return string
     */
    public static function getScripts(Order $order, $formId)
    {
        Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_edit.js");
        Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_ajaxer.js");
        $currencyId = $order->getCurrency();
        $currencies = array();
        if (Loader::includeModule('currency')) {
            \CJSCore::Init(array('currency'));
            $currencyFormat = \CCurrencyLang::getFormatDescription($currencyId);
            $currencies = array(array('CURRENCY' => $currencyId, 'FORMAT' => array('FORMAT_STRING' => $currencyFormat['FORMAT_STRING'], 'DEC_POINT' => $currencyFormat['DEC_POINT'], 'THOUSANDS_SEP' => $currencyFormat['THOUSANDS_SEP'], 'DECIMALS' => $currencyFormat['DECIMALS'], 'THOUSANDS_VARIANT' => $currencyFormat['THOUSANDS_VARIANT'], 'HIDE_ZERO' => "N")));
        }
        $curFormat = \CCurrencyLang::getCurrencyFormat($currencyId);
        $currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
        $langPhrases = array("SALE_ORDEREDIT_DISCOUNT_UNKNOWN", "SALE_ORDEREDIT_REFRESHING_DATA", "SALE_ORDEREDIT_FIX", "SALE_ORDEREDIT_UNFIX");
        $result = '
			<script type="text/javascript">
				BX.ready(function(){
					BX.Sale.Admin.OrderEditPage.orderId = "' . $order->getId() . '";
					BX.Sale.Admin.OrderEditPage.siteId = "' . $order->getSiteId() . '";
					BX.Sale.Admin.OrderEditPage.languageId = "' . LANGUAGE_ID . '";
					BX.Sale.Admin.OrderEditPage.formId = "' . $formId . '_form";
					BX.Sale.Admin.OrderEditPage.adminTabControlId = "' . $formId . '";
					' . (!empty($currencies) ? 'BX.Currency.setCurrencies(' . \CUtil::PhpToJSObject($currencies, false, true, true) . ');' : '') . 'BX.Sale.Admin.OrderEditPage.currency = "' . $currencyId . '";
					BX.Sale.Admin.OrderEditPage.currencyLang = "' . \CUtil::JSEscape($currencyLang) . '";';
        if ($formId == "sale_order_create") {
            $result .= '
					BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters(BX.Sale.Admin.OrderPayment.prototype.getCreateOrderFieldsUpdaters());';
        }
        foreach ($langPhrases as $phrase) {
            $result .= ' BX.message({' . $phrase . ': "' . \CUtil::JSEscape(Loc::getMessage($phrase)) . '"});';
        }
        $result .= '});
			</script>
		';
        return $result;
    }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:41,代碼來源:orderedit.php

示例7: isset

                }
                $balance = isset($arCatalogProduct["STORE_AMOUNT"]) ? FloatVal($arCatalogProduct["QUANTITY"]) . " / " . FloatVal($arCatalogProduct["STORE_AMOUNT"]) : FloatVal($arCatalogProduct["QUANTITY"]);
                $row->AddField("BALANCE", $arItems['TYPE'] != 'S' ? $balance : '');
                if ($arItems['TYPE'] != 'S') {
                    $ratio = isset($arCatalogProduct['MEASURE_RATIO']) ? $arCatalogProduct['MEASURE_RATIO'] : 1;
                    $measure = isset($arCatalogProduct['MEASURE']['SYMBOL_RUS']) ? '&nbsp;' . $arCatalogProduct['MEASURE']['SYMBOL_RUS'] : '';
                    $arParams = array('id' => $arItems["ID"], 'type' => $arCatalogProduct["TYPE"], 'name' => $arItems['NAME'], 'full_quantity' => $arCatalogProduct['QUANTITY'], 'measureRatio' => isset($arCatalogProduct['MEASURE_RATIO']) ? $arCatalogProduct['MEASURE_RATIO'] : 1, 'measure' => isset($arCatalogProduct['MEASURE']['~SYMBOL_RUS']) ? $arCatalogProduct['MEASURE']['~SYMBOL_RUS'] : '', 'quantity' => $ratio);
                    $row->AddField("QUANTITY", '<input type="text" id="' . $tableId . '_qty_' . $arItems["ID"] . '" value="' . $ratio . '" size="5" />' . $measure);
                    unset($measure, $ratio);
                    $arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.SelEl(' . CUtil::PhpToJSObject($arParams) . ', this);');
                    $row->AddField("ACTION", '<a class="select-sku">' . GetMessage('SPS_SELECT') . '</a>');
                } else {
                    $arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.onSectionClick(' . $arItems["ID"] . ',\'' . CUtil::JSEscape($arItems['NAME']) . '\');');
                }
                foreach ($arPrices as $price) {
                    $row->AddViewField("PRICE" . $price['ID'], CCurrencyLang::CurrencyFormat($arItems['PRICES'][$price['ID']]['PRICE'], $arItems['PRICES'][$price['ID']]['CURRENCY'], true));
                }
            }
            addPropsCell($row, $arSelectedProps, $arItems);
            $row->AddViewField('NAME', '<a class="adm-list-table-link"><span class="bx-s-iconset ' . $icon . '"></span>' . htmlspecialcharsex($arItems['NAME']) . '</a>');
            $row->AddActions($arActions);
        }
        $lAdmin->BeginEpilogContent();
        ?>
	<script type="text/javascript">
		<?php 
        foreach ($arSku as $k => $v) {
            ?>
		if (BX('<?php 
            echo $tableId;
            ?>
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:template.php

示例8:

<tr>
	<td width="30%" class="adm-detail-required-field"><?=Loc::getMessage('SEO_YANDEX_STATS_PERIOD')?>:</td>
	<td width="70%">
			<span style="white-space: nowrap; display:inline-block;"><select name="period_sel" onchange="setGraphInterval(this.value)">
					<option value="interval"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_INTERVAL')?></option>
					<option value="week_ago"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_WEEK')?></option>
					<option value="month_ago"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_MONTH')?></option>
				</select>&nbsp;<span id="seo_graph_interval"><?=CalendarDate("date_from", $dateStart->toString(), 'form1', "4")?>&nbsp;&hellip;<?=CalendarDate("date_to", $dateFinish->toString(), 'form1', "4")?></span></span>&nbsp;&nbsp;<input type="button" value="<?=Loc::getMessage('SEO_YANDEX_STATS_PERIOD_APPLY')?>" onclick="loadGraphData()" id="stats_loading_button" name="template_preview"><span id="stats_wait" class="loading-message-text" style="display: none; margin-top: 5px;"><?=Loc::getMessage('SEO_YANDEX_STATS_WAIT')?></span>
	</td>
</tr>
<?
	if($bSale):
?>
<tr>
	<td><?=Loc::getMessage('SEO_YANDEX_STATS_SUM_ORDER_REPIOD')?>:</td>
	<td><span id="banner_profit"><?=\CCurrencyLang::CurrencyFormat(doubleval($bannerProfit), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true)?></span></td>
</tr>
<?
	endif;
?>
<tr>
	<td><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE')?>:</td>
	<td><select onchange="setGraph(this.value)">
		<option value="sum"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SUM')?></option>
		<option value="shows"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SHOWS')?></option>
		<option value="clicks"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_CLICKS')?></option>
	</select></td>
</tr>
<tr>
	<td colspan="2">
<?
開發者ID:nycmic,項目名稱:bittest,代碼行數:31,代碼來源:seo_search_yandex_direct_banner_edit.php

示例9: htmlspecialcharsbx

            ?>
</td>
			<td style="text-align: left;"><?php 
            echo htmlspecialcharsbx($arProductDiscounts["NAME"]);
            ?>
</td>
			<td style="text-align: right;">
			<?php 
            if ($arProductDiscounts["VALUE_TYPE"] == "P") {
                echo $arProductDiscounts["VALUE"] . "%";
            } elseif ($arProductDiscounts["VALUE_TYPE"] == "S") {
                ?>
= <?php 
                echo CCurrencyLang::CurrencyFormat($arProductDiscounts["VALUE"], $arProductDiscounts["CURRENCY"], true);
            } else {
                echo CCurrencyLang::CurrencyFormat($arProductDiscounts["VALUE"], $arProductDiscounts["CURRENCY"], true);
            }
            ?>
			</td>
			<?php 
            if ($bDiscount) {
                ?>
				<td style="text-align: center;">
					<a href="/bitrix/admin/cat_discount_edit.php?ID=<?php 
                echo $arProductDiscounts["ID"];
                ?>
&lang=<?php 
                echo LANGUAGE_ID;
                ?>
#tb" target="_blank"><?php 
                echo GetMessage("C2IT_MODIFY");
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:31,代碼來源:product_edit.php

示例10:

	if($f_TYPE == "E")
	{
		if ($bCatalog)
		{
			if (isset($arCatGroup) && !empty($arCatGroup))
			{
				foreach($arCatGroup as $CatGroup)
				{
					if (array_key_exists("CATALOG_GROUP_".$CatGroup["ID"], $arVisibleColumnsMap))
					{
						$price = "";
						$sHTML = "";
						$selectCur = "";
						if ($bCurrency)
						{
							$price = CCurrencyLang::CurrencyFormat($arRes["CATALOG_PRICE_".$CatGroup["ID"]],$arRes["CATALOG_CURRENCY_".$CatGroup["ID"]], true);
							if ($boolCatalogPrice && $boolEditPrice)
							{
								$selectCur = '<select name="CATALOG_CURRENCY['.$f_ID.']['.$CatGroup["ID"].']" id="CATALOG_CURRENCY['.$f_ID.']['.$CatGroup["ID"].']"';
								if (intval($arRes["CATALOG_EXTRA_ID_".$CatGroup["ID"]])>0)
									$selectCur .= ' disabled readonly';
								if ($CatGroup["BASE"]=="Y")
									$selectCur .= ' onchange="top.ChangeBaseCurrency('.$f_ID.')"';
								$selectCur .= '>';
								foreach ($arCurrencyList as &$arOneCurrency)
								{
									$selectCur .= '<option value="'.$arOneCurrency["CURRENCY"].'"';
									if ($arOneCurrency["~CURRENCY"] == $arRes["CATALOG_CURRENCY_".$CatGroup["ID"]])
										$selectCur .= ' selected';
									$selectCur .= '>'.$arOneCurrency["CURRENCY"].'</option>';
								}
開發者ID:nycmic,項目名稱:bittest,代碼行數:31,代碼來源:iblock_list_admin.php

示例11: getProductDataToFillBasket


//.........這裏部分代碼省略.........
		if (!($arProduct = $rsProducts->Fetch()))
		{
			return array();
		}
		$balance = floatval($arProduct["QUANTITY"]);

		// sku props
		$arSkuData = array();
		$arProps[] = array(
			"NAME" => "Catalog XML_ID",
			"CODE" => "CATALOG.XML_ID",
			"VALUE" => $arElementInfo['~IBLOCK_XML_ID']
		);
		$arSkuProperty = CSaleProduct::GetProductSkuProps($productId, '', true);
		if (!empty($arSkuProperty))
		{
			foreach ($arSkuProperty as &$val)
			{
				$arSkuData[] = array(
					'NAME' => $val['NAME'],
					'VALUE' => $val['VALUE'],
					'CODE' => $val['CODE']
				);
			}
			unset($val);
		}
		$arSkuData[] = array(
			"NAME" => "Product XML_ID",
			"CODE" => "PRODUCT.XML_ID",
			"VALUE" => $arElementInfo["~XML_ID"]
		);

		// currency
		$arCurFormat = CCurrencyLang::GetCurrencyFormat($arElementInfo["CURRENCY"]);
		$priceValutaFormat = str_replace("#", "", $arCurFormat["FORMAT_STRING"]);

		$arElementInfo["WEIGHT"] = $arProduct["WEIGHT"];

		// measure
		$arElementInfo["MEASURE_TEXT"] = "";
		if ((int)$arProduct["MEASURE"] > 0)
		{
			$dbMeasure = CCatalogMeasure::GetList(array(), array("ID" => intval($arProduct["MEASURE"])), false, false, array("ID", "SYMBOL_RUS", "SYMBOL_INTL"));
			if ($arMeasure = $dbMeasure->Fetch())
				$arElementInfo["MEASURE_TEXT"] = ($arMeasure["SYMBOL_RUS"] != '' ? $arMeasure["SYMBOL_RUS"] : $arMeasure["SYMBOL_INTL"]);
		}
		if ($arElementInfo["MEASURE_TEXT"] == '')
		{
			$arElementInfo["MEASURE_TEXT"] = ($defaultMeasure["SYMBOL_RUS"] != '' ? $defaultMeasure["SYMBOL_RUS"] : $defaultMeasure["SYMBOL_INTL"]);
		}


		// ratio
		$arElementInfo["RATIO"] = 1;
		$dbratio = CCatalogMeasureRatio::GetList(array(), array("PRODUCT_ID" => $productId));
		if ($arRatio = $dbratio->Fetch())
			$arElementInfo["RATIO"] = $arRatio["RATIO"];

		// image
		if ($arElementInfo["PREVIEW_PICTURE"] > 0)
			$imgCode = $arElementInfo["PREVIEW_PICTURE"];
		elseif ($arElementInfo["DETAIL_PICTURE"] > 0)
			$imgCode = $arElementInfo["DETAIL_PICTURE"];

		if ($imgCode == "" && count($arParent) > 0)
		{
開發者ID:akniyev,項目名稱:arteva.ru,代碼行數:67,代碼來源:admin_tool.php

示例12: GetMessage

echo 'Y' == $arItem["CUSTOM_PRICE"] ? GetMessage("SOD_BASE_CATALOG_PRICE") : $arItem["NOTES"];
?>
												</div>
										</td>
										<?
									}

									if ($columnCode == "COLUMN_SUM")
									{
										?>
										<td class="COLUMN_SUM" nowrap>
											<?
											if (!CSaleBasketHelper::isSetItem($arItem)):
											?>
												<div><?php 
echo CCurrencyLang::CurrencyFormat($arItem["QUANTITY"] * $arItem["PRICE"], $arItem["CURRENCY"], false);
?>
 <span><?php 
echo $CURRENCY_FORMAT;
?>
</span></div>
											<?
											endif;
											?>
										</td>
										<?
									}

									if (substr($columnCode, 0, 9) == "PROPERTY_")
									{
										?>
開發者ID:akniyev,項目名稱:arteva.ru,代碼行數:31,代碼來源:order_detail.php

示例13: elseif

    $DELIVERY_ID = $fields["DELIVERY_ID"];
} elseif (isset($_REQUEST["DELIVERY_ID"])) {
    $DELIVERY_ID = $_REQUEST["DELIVERY_ID"];
} else {
    $DELIVERY_ID = 0;
}
$DELIVERY_ID = intval($DELIVERY_ID);
if ($DELIVERY_ID <= 0) {
    $strError .= Loc::getMessage("SALE_ESDE_ERROR_ID");
}
$currencyLang = "";
$deliveryService = null;
if ($DELIVERY_ID > 0) {
    $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getService($DELIVERY_ID);
    if ($deliveryService && \Bitrix\Main\Loader::includeModule('currency')) {
        $curFormat = \CCurrencyLang::getCurrencyFormat($deliveryService->getCurrency());
        $currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
    } else {
        $currencyLang = $deliveryService->getCurrency();
    }
}
if ($deliveryService && $ID <= 0 && isset($_GET["ES_CODE"]) && strlen($_GET["ES_CODE"]) > 0) {
    $embeddedList = $deliveryService->getEmbeddedExtraServicesList();
    if (isset($embeddedList[$_GET["ES_CODE"]])) {
        $fields = $embeddedList[$_GET["ES_CODE"]];
        $fields["CODE"] = $_GET["ES_CODE"];
        $fields["ID"] = strval(mktime());
    }
}
$aTabs = array(array("DIV" => "edit_main", "TAB" => Loc::getMessage("SALE_ESDE_TAB_GENERAL"), "ICON" => "sale", "TITLE" => Loc::getMessage("SALE_ESDE_TAB_GENERAL_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:31,代碼來源:delivery_eservice_edit.php

示例14: GetProductSku


//.........這裏部分代碼省略.........
             $arSkuTmp = array();
             $arOffer["CAN_BUY"] = "N";
             $arCatalogProduct = CCatalogProduct::GetByID($arOffer['ID']);
             if (!empty($arCatalogProduct)) {
                 if ($arCatalogProduct["CAN_BUY_ZERO"] != "Y" && ($arCatalogProduct["QUANTITY_TRACE"] == "Y" && doubleval($arCatalogProduct["QUANTITY"]) <= 0)) {
                     $arOffer["CAN_BUY"] = "N";
                 } else {
                     $arOffer["CAN_BUY"] = "Y";
                 }
             }
             $arSkuTmp["ImageUrl"] = '';
             if ($arOffer["CAN_BUY"] == "Y") {
                 $productImg = "";
                 if (isset($arImgSku[$arOffer['ID']]) && !empty($arImgSku[$arOffer['ID']])) {
                     if ('' == $PRODUCT_NAME) {
                         $PRODUCT_NAME = $arImgSku[$arOffer['ID']]["~NAME"];
                     }
                     if ($arImgSku[$arOffer['ID']]["PREVIEW_PICTURE"] != "") {
                         $productImg = $arImgSku[$arOffer['ID']]["PREVIEW_PICTURE"];
                     } elseif ($arImgSku[$arOffer['ID']]["DETAIL_PICTURE"] != "") {
                         $productImg = $arImgSku[$arOffer['ID']]["DETAIL_PICTURE"];
                     }
                     if ($productImg == "") {
                         if ($arProduct["PREVIEW_PICTURE"] != "") {
                             $productImg = $arProduct["PREVIEW_PICTURE"];
                         } elseif ($arProduct["DETAIL_PICTURE"] != "") {
                             $productImg = $arProduct["DETAIL_PICTURE"];
                         }
                     }
                     if ($productImg != "") {
                         $arFile = CFile::GetFileArray($productImg);
                         $productImg = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
                         $arSkuTmp["ImageUrl"] = $productImg["src"];
                     }
                 }
             }
             if ($minItemPrice === 0 || $arPrice["DISCOUNT_PRICE"] < $minItemPrice) {
                 $minItemPrice = $arPrice["DISCOUNT_PRICE"];
                 $minItemPriceFormat = SaleFormatCurrency($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"]);
             }
             foreach ($arIblockOfferProps as $arCode) {
                 if (array_key_exists($arCode["CODE"], $arOffer["PROPERTIES"])) {
                     if (is_array($arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"])) {
                         $arSkuTmp[] = implode("/", $arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"]);
                     } else {
                         $arSkuTmp[] = $arOffer["PROPERTIES"][$arCode["CODE"]]["VALUE"];
                     }
                 }
             }
             if (!empty($arCatalogProduct)) {
                 $arSkuTmp["BALANCE"] = $arCatalogProduct["QUANTITY"];
                 $arSkuTmp["WEIGHT"] = $arCatalogProduct["WEIGHT"];
                 $arSkuTmp["BARCODE_MULTI"] = $arCatalogProduct["BARCODE_MULTI"];
             } else {
                 $arSkuTmp["BALANCE"] = 0;
                 $arSkuTmp["WEIGHT"] = 0;
                 $arSkuTmp["BARCODE_MULTI"] = 'N';
             }
             $urlEdit = CIBlock::GetAdminElementEditLink($arOffer["IBLOCK_ID"], $arOffer['ID'], array('find_section_section' => 0, 'WF' => 'Y'));
             $discountPercent = 0;
             $arSkuTmp["USER_ID"] = $USER_ID;
             $arSkuTmp["ID"] = $arOffer["ID"];
             $arSkuTmp["NAME"] = CUtil::JSEscape($arOffer["NAME"]);
             $arSkuTmp["PRODUCT_NAME"] = CUtil::JSEscape($PRODUCT_NAME);
             $arSkuTmp["PRODUCT_ID"] = $PRODUCT_ID;
             $arSkuTmp["LID"] = CUtil::JSEscape($LID);
             $arSkuTmp["MIN_PRICE"] = $minItemPriceFormat;
             $arSkuTmp["URL_EDIT"] = $urlEdit;
             $arSkuTmp["DISCOUNT_PRICE"] = '';
             $arSkuTmp["DISCOUNT_PRICE_FORMATED"] = '';
             $arSkuTmp["PRICE"] = $arPrice["PRICE"]["PRICE"];
             $arSkuTmp["PRICE_FORMATED"] = CCurrencyLang::CurrencyFormat($arPrice["PRICE"]["PRICE"], $arPrice["PRICE"]["CURRENCY"], false);
             $arPriceType = GetCatalogGroup($arPrice["PRICE"]["CATALOG_GROUP_ID"]);
             $arSkuTmp["PRICE_TYPE"] = $arPriceType["NAME_LANG"];
             $arSkuTmp["VAT_RATE"] = $arPrice["PRICE"]["VAT_RATE"];
             if (count($arPrice["DISCOUNT"]) > 0) {
                 $discountPercent = IntVal($arPrice["DISCOUNT"]["VALUE"]);
                 $arSkuTmp["DISCOUNT_PRICE"] = $arPrice["DISCOUNT_PRICE"];
                 $arSkuTmp["DISCOUNT_PRICE_FORMATED"] = CCurrencyLang::CurrencyFormat($arPrice["DISCOUNT_PRICE"], $arPrice["PRICE"]["CURRENCY"], false);
             }
             $arCurFormat = CCurrencyLang::GetCurrencyFormat($arPrice["PRICE"]["CURRENCY"]);
             $arSkuTmp["VALUTA_FORMAT"] = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
             $arSkuTmp["DISCOUNT_PERCENT"] = $discountPercent;
             $arSkuTmp["CURRENCY"] = $arPrice["PRICE"]["CURRENCY"];
             $arSkuTmp["CAN_BUY"] = $arOffer["CAN_BUY"];
             $arSku[] = $arSkuTmp;
         }
         if ((!is_array($arIblockOfferProps) || empty($arIblockOfferProps)) && is_array($arSku) && !empty($arSku)) {
             $arIblockOfferProps[0] = array("CODE" => "TITLE", "NAME" => GetMessage("SKU_TITLE"));
             foreach ($arSku as $key => $val) {
                 $arSku[$key][0] = $val["NAME"];
             }
         }
         $arResult["SKU_ELEMENTS"] = $arSku;
         $arResult["SKU_PROPERTIES"] = $arIblockOfferProps;
         $arResult["OFFERS_IBLOCK_ID"] = $arOffersIblock[$arProduct["IBLOCK_ID"]];
     }
     //if OFFERS_IBLOCK_ID > 0
     return $arResult;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:101,代碼來源:product.php

示例15: foreach

CCurrencyLang::disableUseHideZero();
$orderId = (int) $GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["ID"];
if ($orderId) {
    /** @var \Bitrix\Sale\Order $order */
    $order = \Bitrix\Sale\Order::load($orderId);
    if ($order) {
        /** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
        $paymentCollection = $order->getPaymentCollection();
        if ($paymentCollection) {
            /** @var \Bitrix\Sale\Payment $payment */
            foreach ($paymentCollection as $payment) {
                if (!$payment->isInner()) {
                    break;
                }
            }
            if ($payment) {
                $context = \Bitrix\Main\Application::getInstance()->getContext();
                $service = \Bitrix\Sale\PaySystem\Manager::getObjectById($payment->getPaymentSystemId());
                if ($_REQUEST['pdf'] && $_REQUEST['GET_CONTENT'] == 'Y') {
                    $result = $service->initiatePay($payment, $context->getRequest(), \Bitrix\Sale\PaySystem\BaseServiceHandler::STRING);
                    if ($result->isSuccess()) {
                        return $result->getTemplate();
                    }
                }
                $result = $service->initiatePay($payment, $context->getRequest());
            }
            CCurrencyLang::enableUseHideZero();
        }
    }
}
開發者ID:akniyev,項目名稱:itprom_dobrohost,代碼行數:30,代碼來源:payment.php


注:本文中的CCurrencyLang類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。