本文整理汇总了PHP中CCurrencyLang类的典型用法代码示例。如果您正苦于以下问题:PHP CCurrencyLang类的具体用法?PHP CCurrencyLang怎么用?PHP CCurrencyLang使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCurrencyLang类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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']) ? ' ' . $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> <span id="seo_graph_interval"><?=CalendarDate("date_from", $dateStart->toString(), 'form1', "4")?> …<?=CalendarDate("date_to", $dateFinish->toString(), 'form1', "4")?></span></span> <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
示例16: CalcDiscount
/**
* Метод модифицирует массив $arResult, добавляя в него скидку Carrot quest
* <b>Параметры:</b>
* <var>$arResult</var> - Массив в формате битрикс, содержащий параметры заказа.
* <b>Возвращаемое значение:</b>
* Измененный <var>$arResult</var>
* <var>$_COOKIE['carrotquest_price']</var> - стоимость заказа с учетом скидки Carrot quest
*/
public function CalcDiscount($arResult)
{
// Вычисляем скидку
$total = $arResult['ORDER_PRICE'];
$CarrotInfo = $this->GetSelectedCarrots();
if ($CarrotInfo)
{
// Максимальное количетво морковок, которым можно расплатиться за заказ
$max_carrots = floor($total * $CarrotInfo['max_discount']);
// Валидация скидки
if ( $CarrotInfo['carrots_selected'] > $max_carrots || $CarrotInfo['carrots_selected'] < 0)
$discount_percent = 0;
else
// Доля скидки
$discount_percent = round($CarrotInfo['carrots_selected'] * $CarrotInfo['max_discount'] / $max_carrots, 4);
// Стоимость скидки в рублях
$discount_value = floor($total * $discount_percent);
// Перопределяем итоговую стоимость
$arResult["CARROTQUEST_DISCOUNT_PRICE"] = $discount_value;
$arResult["CARROTQUEST_DISCOUNT_PRICE_FORMATED"] = CCurrencyLang::CurrencyFormat($discount_value, "RUB", true);
$priceFormat = $arResult["ORDER_TOTAL_PRICE_FORMATED"];
$price = 0;
for ($i = 0, $out = false; !$out && $i < strlen($priceFormat); $i++)
{
if ($priceFormat[$i] == ' ');
elseif (ord($priceFormat[$i]) >= 48 && ord($priceFormat[$i]) <= 57)
$price = $price * 10 + $priceFormat[$i];
else
$out = true;
}
$result_price = $price - $discount_value;
// Устанавливаем кук для обработчика оформления заказа
setcookie('carrotquest_price',$result_price,0, "/");
$arResult["ORDER_TOTAL_PRICE_FORMATED"] = CCurrencyLang::CurrencyFormat($result_price, "RUB", true);
}
return $arResult;
}
开发者ID:ASDAFF,项目名称:BitrixCarrotquestModule,代码行数:52,代码来源:CarrotQuestApi.php
示例17: getEditTemplate
private static function getEditTemplate($data, $index, $post = array())
{
$paid = $post ? $post['PAID'] : $data['PAID'];
$id = $post ? $post['PAYMENT_ID'] : $data['ID'];
$paidString = $paid == 'Y' ? 'YES' : 'NO';
if (!$post) {
if ($data['SUM'] > 0) {
$sum = $data['SUM'];
} else {
$sum = $data['ORDER_PRICE'] - $data['ORDER_PAYMENT_SUM'] <= 0 ? 0 : $data['ORDER_PRICE'] - $data['ORDER_PAYMENT_SUM'];
}
} else {
$sum = $post['SUM'];
}
$psData = self::getPaySystemParams(isset($post['PAY_SYSTEM_ID']) ? $post['PAY_SYSTEM_ID'] : $data['PAY_SYSTEM_ID'], $data['PERSON_TYPE_ID']);
if (isset($psData["LOGOTIP_PATH"])) {
$data['PAY_SYSTEM_LOGOTIP'] = $psData["LOGOTIP_PATH"];
}
$paymentStatus = '<span><span id="BUTTON_PAID_' . $index . '" ' . ($paid != 'Y' ? 'class="notpay"' : '') . '>' . Loc::getMessage('SALE_ORDER_PAYMENT_STATUS_' . $paidString) . '</span><span class="triangle"> ▾</span></span>';
$note = BeginNote();
$note .= Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_ALERT');
$note .= EndNote();
$hiddenPaySystemInnerId = '';
if ($index == 1) {
$hiddenPaySystemInnerId = '<input type="hidden" value="' . PaySystemInner::getId() . '" id="PAYMENT_INNER_BUDGET_ID">';
}
$notPaidBlock = $paid == 'N' && !empty($data['EMP_PAID_ID']) ? '' : 'style="display:none;"';
$return = $post['IS_RETURN'] == 'Y' ? '' : 'style="display:none;"';
$returnInformation = '
<tr ' . $return . ' class="return">
<td class="adm-detail-content-cell-l fwb">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_TO') . ':</td>
<td class="adm-detail-content-cell-r">
<select name="PAYMENT[' . $index . '][OPERATION_ID]" id="OPERATION_ID_' . $index . '" class="adm-bus-select">
<option value="RETURN">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_ACCOUNT') . '</option>
</select>
</td>
</tr>
<tr ' . $return . ' class="return">
<td colspan="2" style="text-align: center">' . $note . '</td>
</tr>
<tr ' . $notPaidBlock . ' class="not_paid">
<td class="adm-detail-content-cell-l" width="40%"><br>' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_NUM') . ':</td>
<td class="adm-detail-content-cell-r tal">
<br>
<input type="text" class="adm-bus-input" name="PAYMENT[' . $index . '][PAY_RETURN_NUM]" id="PAYMENT_RETURN_NUM_' . $index . '" value="' . htmlspecialcharsbx($post['PAY_RETURN_NUM'] ? $post['PAY_RETURN_NUM'] : $data['PAY_RETURN_NUM']) . '" maxlength="20">
</td>
</tr>
<tr ' . $notPaidBlock . ' class="not_paid">
<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_PAY_RETURN_DATE') . ':</td>
<td class="adm-detail-content-cell-r tal">
<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
<input type="text" class="adm-input adm-calendar-to" name="PAYMENT[' . $index . '][PAY_RETURN_DATE]" id="PAYMENT_RETURN_DATE_' . $index . '" size="15" value="' . htmlspecialcharsbx($post['PAY_RETURN_DATE'] ? $post['PAY_RETURN_DATE'] : $data['PAY_RETURN_DATE']) . '">
<span class="adm-calendar-icon" title="' . Loc::getMessage('SALE_ORDER_PAYMENT_CHOOSE_DATE') . '" onclick="BX.calendar({node:this, field:\'PAYMENT_RETURN_DATE_' . $index . '\', form: \'\', bTime: false, bHideTime: false});"></span>
</div>
</td>
</tr>
<tr ' . $notPaidBlock . ' class="not_paid">
<td class="adm-detail-content-cell-l" width="40%">' . Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_COMMENT') . ':</td>
<td class="adm-detail-content-cell-r tal">
<div class="adm-input-wrap adm-calendar-second" style="display: inline-block;">
<textarea name="PAYMENT[' . $index . '][PAY_RETURN_COMMENT]" id="PAYMENT_RETURN_COMMENTS_' . $index . '">' . htmlspecialcharsbx(isset($post['PAY_RETURN_COMMENT']) ? $post['PAY_RETURN_COMMENT'] : $data['PAY_RETURN_COMMENT']) . '</textarea>
</div>
</td>
</tr>';
$lang = Main\Application::getInstance()->getContext()->getLanguage();
$title = $id > 0 ? Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_EDIT_PAYMENT_TITLE') . '#' . $id : Loc::getMessage('SALE_ORDER_PAYMENT_BLOCK_NEW_PAYMENT_TITLE') . '#' . $index;
$curFormat = \CCurrencyLang::getCurrencyFormat($data['CURRENCY']);
$currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
$disabled = $data['PAID'] == 'Y' ? 'readonly' : '';
$companyList = OrderEdit::getCompanyList();
if (!empty($companyList)) {
$companies = \Bitrix\Sale\Helpers\Admin\OrderEdit::makeSelectHtml('PAYMENT[' . $index . '][COMPANY_ID]', $companyList, isset($post["COMPANY_ID"]) ? $post["COMPANY_ID"] : $data["COMPANY_ID"], true, array("class" => "adm-bus-select", "id" => "COMPANY_ID"));
} else {
$companies = str_replace("#URL#", "/bitrix/admin/sale_company_edit.php?lang=" . $lang, Loc::getMessage('SALE_ORDER_PAYMENT_ADD_COMPANY'));
}
$result = '<div>
<div class="adm-bus-pay" id="payment_container_' . $index . '">
<input type="hidden" name="PAYMENT[' . $index . '][PAYMENT_ID]" id="payment_id_' . $index . '" value="' . $id . '">
<input type="hidden" name="PAYMENT[' . $index . '][INDEX]" value="' . $index . '" class="index">
<input type="hidden" name="PAYMENT[' . $index . '][PAID]" id="PAYMENT_PAID_' . $index . '" value="' . (empty($paid) ? 'N' : $paid) . '">
<input type="hidden" name="PAYMENT[' . $index . '][IS_RETURN]" id="PAYMENT_IS_RETURN_' . $index . '" value="' . ($post['IS_RETURN'] ? $post['IS_RETURN'] : 'N') . '">
' . $hiddenPaySystemInnerId . '
<div class="adm-bus-component-content-container">
<div class="adm-bus-pay-section">
<div class="adm-bus-pay-section-title-container">
<div class="adm-bus-pay-section-title">' . $title . '</div>
<div class="adm-bus-pay-section-action-block">' . (!isset($data['ID']) || $data['ID'] <= 0 ? '<div class="adm-bus-pay-section-action" id="SECTION_' . $index . '_DELETE">' . Loc::getMessage('SALE_ORDER_PAYMENT_DELETE') . '</div>' : '') . '</div>
</div>
<div class="adm-bus-pay-section-content" id="SECTION_' . $index . '">
<div class="adm-bus-pay-section-sidebar">
<div class="adm-bus-pay-section-sidebar-service-logo">
<img id="LOGOTIP_' . $index . '" src="' . $data['PAY_SYSTEM_LOGOTIP'] . '" alt="">
</div>
</div>
<div class="adm-bus-pay-section-right">
<div class="adm-bus-table-container caption border">
<div class="adm-bus-table-caption-title" style="background: #eef5f5;">' . Loc::getMessage('SALE_ORDER_PAYMENT_METHOD') . '</div>
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="adm-detail-content-table edit-table ">
<tbody>
<tr>
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:orderpayment.php
示例18: GetFormatDescription
|
请发表评论