当前位置: 首页>>代码示例>>PHP>>正文


PHP CSaleLang类代码示例

本文整理汇总了PHP中CSaleLang的典型用法代码示例。如果您正苦于以下问题:PHP CSaleLang类的具体用法?PHP CSaleLang怎么用?PHP CSaleLang使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CSaleLang类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PrepareCurrency4Where

	public static function PrepareCurrency4Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
	{
		$val = DoubleVal($val);

		$baseSiteCurrency = "";
		if (isset($arFilter["LID"]) && strlen($arFilter["LID"]) > 0)
			$baseSiteCurrency = CSaleLang::GetLangCurrency($arFilter["LID"]);
		elseif (isset($arFilter["CURRENCY"]) && strlen($arFilter["CURRENCY"]) > 0)
			$baseSiteCurrency = $arFilter["CURRENCY"];

		if (strlen($baseSiteCurrency) <= 0)
			return False;

		$strSqlSearch = "";

		$dbCurrency = CCurrency::GetList(($by = "sort"), ($order = "asc"));
		while ($arCurrency = $dbCurrency->Fetch())
		{
			$val1 = roundEx(CCurrencyRates::ConvertCurrency($val, $baseSiteCurrency, $arCurrency["CURRENCY"]), SALE_VALUE_PRECISION);
			if (strlen($strSqlSearch) > 0)
				$strSqlSearch .= " OR ";

			$strSqlSearch .= "(D.ORDER_CURRENCY = '".$arCurrency["CURRENCY"]."' AND ";
			if ($negative == "Y")
				$strSqlSearch .= "NOT";
			$strSqlSearch .= "(".$field." ".$operation." ".$val1." OR ".$field." IS NULL OR ".$field." = 0)";
			$strSqlSearch .= ")";
		}

		return "(".$strSqlSearch.")";
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:31,代码来源:delivery.php

示例2: onFinishChange

 /**
  * @param \DDelivery\Order\DDeliveryOrder $order
  * @throws \Bitrix\Main\ArgumentException
  */
 public function onFinishChange($order)
 {
     global $APPLICATION;
     $point = $order->getPoint();
     if ($order->type == DDeliverySDK::TYPE_SELF) {
         $replaceData = array('%1' => $order->cityName, '%2' => $point['address'], '%3' => $point['delivery_company_name'], '%4' => $point['_id'], '%5' => $point['type'] == 1 ? 'Постомат' : 'ПВЗ');
         $replaceData = $APPLICATION->ConvertCharsetArray($replaceData, 'UTF-8', SITE_CHARSET);
         $comment = GetMessage('DDELIVERY_ABOUT_SELF', $replaceData);
     } else {
         if ($order->type == DDeliverySDK::TYPE_COURIER) {
             $replaceData = array('%1' => $order->getFullAddress(), '%2' => $point['delivery_company_name']);
             $replaceData = $APPLICATION->ConvertCharsetArray($replaceData, 'UTF-8', SITE_CHARSET);
             $comment = GetMessage('DDELIVERY_ABOUT_COURIER', $replaceData);
         } else {
             $comment = 'error';
         }
     }
     $orderId = $this->formData['bx_order_id'];
     $params = array('DD_ABOUT' => $comment, 'DD_LOCAL_ID' => $order->localId);
     $orderDeliveryTableData = OrderDeliveryTable::getList(array('filter' => array('ORDER_ID' => $orderId)))->fetch();
     if ($orderDeliveryTableData) {
         OrderDeliveryTable::update($orderDeliveryTableData['ID'], array('PARAMS' => serialize($params)));
     } else {
         OrderDeliveryTable::add(array('ORDER_ID' => $orderId, 'PARAMS' => serialize($params)));
     }
     $order = CSaleOrder::GetByID($orderId);
     $arDeliveryResult = CSaleDeliveryHandler::CalculateFull('ddelivery', 'ddelivery:all', $order, CSaleLang::GetLangCurrency(SITE_ID), SITE_ID);
     if ($arDeliveryResult['RESULT'] == 'OK') {
         CSaleOrder::Update($orderId, array('PRICE_DELIVERY' => $arDeliveryResult['VALUE']));
     }
 }
开发者ID:ASDAFF,项目名称:DDelivery,代码行数:35,代码来源:DDeliveryAdminShop.php

示例3: GetLangCurrency

 function GetLangCurrency($LID)
 {
     $LID = trim($LID);
     if (strlen($LID) <= 0) {
         return false;
     }
     $def_curr = "";
     if ($res = CSaleLang::GetByID($LID)) {
         $def_curr = $res["CURRENCY"];
     }
     if (strlen($def_curr) <= 0) {
         $def_curr = COption::GetOptionString("sale", "default_currency");
     }
     return $def_curr;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:15,代码来源:settings.php

示例4: init

 public function init()
 {
     $this->username = CSalePaySystemAction::GetParamValue("USER");
     $this->pwd = CSalePaySystemAction::GetParamValue("PWD");
     $this->signature = CSalePaySystemAction::GetParamValue("SIGNATURE");
     $this->currency = CSalePaySystemAction::GetParamValue("CURRENCY");
     $this->testMode = CSalePaySystemAction::GetParamValue("TEST") == "Y";
     $this->notifyUrl = CSalePaySystemAction::GetParamValue("NOTIFY_URL");
     if (strlen($this->currency) <= 0) {
         $this->currency = CSaleLang::GetLangCurrency(SITE_ID);
     }
     if ($this->testMode) {
         $this->domain = "sandbox.";
     }
     if (strlen($_REQUEST["token"]) > 0) {
         $this->token = $_REQUEST["token"];
     }
     if (strlen($_REQUEST["PayerID"]) > 0) {
         $this->payerId = $_REQUEST["PayerID"];
     }
     $this->version = "98.0";
     $dbSite = CSite::GetByID(SITE_ID);
     $arSite = $dbSite->Fetch();
     $this->serverName = $arSite["SERVER_NAME"];
     if (strLen($this->serverName) <= 0) {
         if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
             $this->serverName = SITE_SERVER_NAME;
         } else {
             $this->serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
         }
     }
     $this->serverName = (CMain::IsHTTPS() ? "https" : "http") . "://" . $this->serverName;
     if (strlen($this->username) <= 0 || strlen($this->username) <= 0 || strlen($this->username) <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException("CSalePaySystempaypal: init error", "CSalePaySystempaypal_init_error");
         return false;
     }
     return true;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:38,代码来源:pre_payment.php

示例5: base64_encode

$strHidden = '';
$strApp = base64_encode(serialize($arDiscount['ACTIONS']));
$tabControl->EndCustomField('ACTIONS', '<input type="hidden" name="ACTIONS" value="' . htmlspecialcharsbx($strApp) . '">' . '<input type="hidden" name="ACTIONS_CHECK" value="' . htmlspecialcharsbx(md5($strApp)) . '">');
$tabControl->AddSection("BT_SALE_DISCOUNT_SECT_COND", GetMessage("BT_SALE_DISCOUNT_SECTIONS_COND_ADD"));
$tabControl->BeginCustomField("CONDITIONS", GetMessage('BT_SALE_DISCOUNT_EDIT_FIELDS_COND_ADD') . ":", false);
?>
<tr id="tr_CONDITIONS">
		<td valign="top" colspan="2"><div id="tree" style="position: relative; z-index: 1;"></div><?php 
if (!is_array($arDiscount['CONDITIONS'])) {
    if (CheckSerializedData($arDiscount['CONDITIONS'])) {
        $arDiscount['CONDITIONS'] = unserialize($arDiscount['CONDITIONS']);
    } else {
        $arDiscount['CONDITIONS'] = '';
    }
}
$arCondParams = array('FORM_NAME' => 'sale_discount_form', 'CONT_ID' => 'tree', 'JS_NAME' => 'JSSaleCond', 'INIT_CONTROLS' => array('SITE_ID' => $arDiscount['LID'], 'CURRENCY' => CSaleLang::GetLangCurrency($arDiscount['LID'])));
$obCond = new CSaleCondTree();
$boolCond = $obCond->Init(BT_COND_MODE_DEFAULT, BT_COND_BUILD_SALE, $arCondParams);
if (!$boolCond) {
    if ($ex = $APPLICATION->GetException()) {
        echo $ex->GetString() . "<br>";
    }
} else {
    $obCond->Show($arDiscount['CONDITIONS']);
}
?>
</td>
	</tr><?php 
$strHidden = '';
$strCond = base64_encode(serialize($arDiscount['CONDITIONS']));
$tabControl->EndCustomField('CONDITIONS', '<input type="hidden" name="CONDITIONS" value="' . htmlspecialcharsbx($strCond) . '">' . '<input type="hidden" name="CONDITIONS_CHECK" value="' . htmlspecialcharsbx(md5($strCond)) . '">');
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:discount_edit.php

示例6: array

}
if ($USER->GetID() <= 0) {
    $APPLICATION->AuthForm(GetMessage('SPT_ACCESS_DENIED'));
    return;
}
if (!is_array($arParams['ALLOWED_CURRENCY'])) {
    $arParams['ALLOWED_CURRENCY'] = array();
}
$arParams['COMISSION'] = round($arParams['COMISSION'], 2);
$arParams['CART_PAGE'] = trim($arParams['CART_PAGE']);
$arParams['PAY_IMMED'] = isset($arParams['PAY_IMMED']) && $arParams['PAY_IMMED'] == 'Y';
$arResult = array();
$arResult['ACCOUNT'] = array();
$arResult['CURRENCIES'] = array();
$arResult['ERROR'] = '';
$arResult['LANG_CURRENCY'] = CSaleLang::GetLangCurrency(SITE_ID);
$arResult['REQUEST_AMOUNT'] = $_REQUEST['amount'] > 0 ? round(str_replace(',', '.', trim($_REQUEST['amount'])), 2) : '';
$arResult['REQUEST_ACCOUNT'] = isset($_REQUEST['account']) ? $_REQUEST['account'] : $arParams['DEFAULT_CURRENCY'];
$arResult['REQUEST_PAY_SYSTEM'] = isset($_REQUEST['pay_system']) ? $_REQUEST['pay_system'] : 0;
$i = 0;
$rsCurrency = CCurrency::GetList($by = 'name', $order = 'desc', LANGUAGE_ID);
while ($arCurrency = $rsCurrency->Fetch()) {
    $arCurrency['ID'] = ++$i;
    if ($arCurrency['CURRENCY'] != $arResult['LANG_CURRENCY']) {
        $arCurrency['FACTOR'] = round(CCurrencyRates::GetConvertFactor($arCurrency['CURRENCY'], $arResult['LANG_CURRENCY']), 2);
    } else {
        $arCurrency['FACTOR'] = 1;
    }
    $arResult['CURRENCIES'][$arCurrency['CURRENCY']] = $arCurrency;
    if (empty($arParams['ALLOWED_CURRENCY']) || in_array($arCurrency['CURRENCY'], $arParams['ALLOWED_CURRENCY'])) {
        $arResult['ACCOUNT'][$arCurrency['CURRENCY']] = array();
开发者ID:Hawkart,项目名称:megatv,代码行数:31,代码来源:component.php

示例7: SubscribeProduct

/**
 * @param int $intProductID
 * @param array $arRewriteFields
 * @param array $arProductParams
 * @return bool|int
 */
function SubscribeProduct($intProductID, $arRewriteFields = array(), $arProductParams = array())
{
    global $USER, $APPLICATION;
    if (!CCatalog::IsUserExists()) {
        return false;
    }
    if (!$USER->IsAuthorized()) {
        return false;
    }
    $intUserID = (int) $USER->GetID();
    $intProductID = (int) $intProductID;
    if ($intProductID <= 0) {
        $APPLICATION->ThrowException(Loc::getMessage('CATALOG_ERR_EMPTY_PRODUCT_ID'), "EMPTY_PRODUCT_ID");
        return false;
    }
    if (!Loader::includeModule("sale")) {
        $APPLICATION->ThrowException(Loc::getMessage('CATALOG_ERR_NO_SALE_MODULE'), "NO_SALE_MODULE");
        return false;
    }
    if (Loader::includeModule("statistic") && isset($_SESSION['SESS_SEARCHER_ID']) && (int) $_SESSION["SESS_SEARCHER_ID"] > 0) {
        $APPLICATION->ThrowException(Loc::getMessage('CATALOG_ERR_SESS_SEARCHER'), "SESS_SEARCHER");
        return false;
    }
    $rsProducts = CCatalogProduct::GetList(array(), array('ID' => $intProductID), false, false, array('ID', 'WEIGHT', 'WIDTH', 'HEIGHT', 'LENGTH', 'TYPE', 'MEASURE', 'SUBSCRIBE'));
    if (!($arCatalogProduct = $rsProducts->Fetch())) {
        $APPLICATION->ThrowException(Loc::getMessage('CATALOG_ERR_NO_PRODUCT'), "NO_PRODUCT");
        return false;
    }
    if ($arCatalogProduct['SUBSCRIBE'] == 'N') {
        $APPLICATION->ThrowException(Loc::getMessage('CATALOG_ERR_NO_SUBSCRIBE'), 'SUBSCRIBE');
        return false;
    }
    $arCatalogProduct['MEASURE'] = (int) $arCatalogProduct['MEASURE'];
    $arCatalogProduct['MEASURE_NAME'] = '';
    $arCatalogProduct['MEASURE_CODE'] = 0;
    if ($arCatalogProduct['MEASURE'] <= 0) {
        $arMeasure = CCatalogMeasure::getDefaultMeasure(true, true);
        $arCatalogProduct['MEASURE_NAME'] = $arMeasure['~SYMBOL_RUS'];
        $arCatalogProduct['MEASURE_CODE'] = $arMeasure['CODE'];
    } else {
        $rsMeasures = CCatalogMeasure::getList(array(), array('ID' => $arCatalogProduct['MEASURE']), false, false, array('ID', 'SYMBOL_RUS', 'CODE'));
        if ($arMeasure = $rsMeasures->GetNext()) {
            $arCatalogProduct['MEASURE_NAME'] = $arMeasure['~SYMBOL_RUS'];
            $arCatalogProduct['MEASURE_CODE'] = $arMeasure['CODE'];
        }
    }
    $rsItems = CIBlockElement::GetList(array(), array("ID" => $intProductID, "ACTIVE" => "Y", "ACTIVE_DATE" => "Y", "CHECK_PERMISSIONS" => "Y", "MIN_PERMISSION" => "R"), false, false, array('ID', 'IBLOCK_ID', 'NAME', 'XML_ID', 'DETAIL_PAGE_URL'));
    if (!($arProduct = $rsItems->GetNext())) {
        return false;
    }
    $arParentSku = CCatalogSku::GetProductInfo($intProductID, $arProduct['IBLOCK_ID']);
    if (!empty($arParentSku)) {
        if (strpos($arProduct["~XML_ID"], '#') === false) {
            $parentIterator = Iblock\ElementTable::getList(array('select' => array('ID', 'XML_ID'), 'filter' => array('ID' => $arParentSku['ID'])));
            if ($parent = $parentIterator->fetch()) {
                $arProduct["~XML_ID"] = $parent['XML_ID'] . '#' . $arProduct["~XML_ID"];
            }
            unset($parent, $parentIterator);
        }
    }
    $arPrice = array('PRICE' => 0.0, 'CURRENCY' => CSaleLang::GetLangCurrency(SITE_ID), 'VAT_RATE' => 0, 'PRODUCT_PRICE_ID' => 0, 'CATALOG_GROUP_NAME' => '');
    $arBuyerGroups = $USER->GetUserGroupArray();
    $arSubscrPrice = CCatalogProduct::GetOptimalPrice($intProductID, 1, $arBuyerGroups, "N", array(), SITE_ID, array());
    if (!empty($arSubscrPrice) && is_array($arSubscrPrice)) {
        $arPrice['PRICE'] = $arSubscrPrice['DISCOUNT_PRICE'];
        $arPrice['CURRENCY'] = CCurrency::GetBaseCurrency();
        $arPrice['VAT_RATE'] = $arSubscrPrice['PRICE']['VAT_RATE'];
        $arPrice['PRODUCT_PRICE_ID'] = $arSubscrPrice["PRICE"]["ID"];
        $arPrice['CATALOG_GROUP_NAME'] = $arSubscrPrice["PRICE"]["CATALOG_GROUP_NAME"];
    }
    $arProps = array();
    $strIBlockXmlID = (string) CIBlock::GetArrayByID($arProduct['IBLOCK_ID'], 'XML_ID');
    if ($strIBlockXmlID !== '') {
        $arProps[] = array("NAME" => "Catalog XML_ID", "CODE" => "CATALOG.XML_ID", "VALUE" => $strIBlockXmlID);
    }
    if (!empty($arProductParams) && is_array($arProductParams)) {
        foreach ($arProductParams as &$arOneProductParams) {
            $arProps[] = array("NAME" => $arOneProductParams["NAME"], "CODE" => $arOneProductParams["CODE"], "VALUE" => $arOneProductParams["VALUE"], "SORT" => $arOneProductParams["SORT"]);
        }
        unset($arOneProductParams);
    }
    $arProps[] = array("NAME" => "Product XML_ID", "CODE" => "PRODUCT.XML_ID", "VALUE" => $arProduct["XML_ID"]);
    $arFields = array("PRODUCT_ID" => $intProductID, "PRODUCT_PRICE_ID" => $arPrice['PRODUCT_PRICE_ID'], "PRICE" => $arPrice['PRICE'], "CURRENCY" => $arPrice['CURRENCY'], "WEIGHT" => $arCatalogProduct["WEIGHT"], "DIMENSIONS" => serialize(array("WIDTH" => $arCatalogProduct["WIDTH"], "HEIGHT" => $arCatalogProduct["HEIGHT"], "LENGTH" => $arCatalogProduct["LENGTH"])), "QUANTITY" => 1, "LID" => SITE_ID, "DELAY" => "N", "CAN_BUY" => "N", "SUBSCRIBE" => "Y", "NAME" => $arProduct["~NAME"], "MODULE" => "catalog", "PRODUCT_PROVIDER_CLASS" => "CCatalogProductProvider", "NOTES" => $arPrice["CATALOG_GROUP_NAME"], "DETAIL_PAGE_URL" => $arProduct["~DETAIL_PAGE_URL"], "CATALOG_XML_ID" => $strIBlockXmlID, "PRODUCT_XML_ID" => $arProduct["~XML_ID"], "PROPS" => $arProps, "TYPE" => $arCatalogProduct["TYPE"] == CCatalogProduct::TYPE_SET ? CCatalogProductSet::TYPE_SET : NULL, "MEASURE_NAME" => $arCatalogProduct['MEASURE_NAME'], "MEASURE_CODE" => $arCatalogProduct['MEASURE_CODE'], 'IGNORE_CALLBACK_FUNC' => 'Y');
    if (!empty($arRewriteFields) && is_array($arRewriteFields)) {
        if (array_key_exists('SUBSCRIBE', $arRewriteFields)) {
            unset($arRewriteFields['SUBSCRIBE']);
        }
        if (array_key_exists('CAN_BUY', $arRewriteFields)) {
            unset($arRewriteFields['CAN_BUY']);
        }
        if (array_key_exists('DELAY', $arRewriteFields)) {
            unset($arRewriteFields['DELAY']);
        }
        if (!empty($arRewriteFields)) {
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:include.php

示例8: GetMessage

echo GetMessage("SOE_NEW_ITEMS");
?>
</a>
			<?endif;?>
			<a title="<?php 
echo GetMessage("SOE_ADD_ITEMS");
?>
" onClick="AddProductSearch(1);" class="adm-btn adm-btn-green adm-btn-add" href="javascript:void(0);"><?php 
echo GetMessage("SOE_ADD_ITEMS");
?>
</a>
		</div>

<script type="text/javascript">
	var currencyBase = '<?php 
echo CSaleLang::GetLangCurrency($LID);
?>
';
	var orderWeight = '<?php 
echo $productWeight;
?>
';
	var orderPrice = '<?php 
echo $str_PRICE;
?>
';

	function fEnableSub()
	{
		if (document.getElementById('tbl_sale_order_edit'))
			document.getElementById('tbl_sale_order_edit').style.zIndex  = 10000;
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:order_new.php

示例9: DoCalculateOrder

 static function DoCalculateOrder($siteId, $userId, $arShoppingCart, $personTypeId, $arOrderPropsValues, $deliveryId, $paySystemId, $arOptions, &$arErrors, &$arWarnings)
 {
     $siteId = trim($siteId);
     if (empty($siteId)) {
         $arErrors[] = array("CODE" => "PARAM", "TEXT" => GetMessage('SKGO_CALC_PARAM_ERROR'));
         return null;
     }
     $userId = intval($userId);
     if (!is_array($arShoppingCart) || count($arShoppingCart) <= 0) {
         $arErrors[] = array("CODE" => "PARAM", "TEXT" => GetMessage('SKGO_SHOPPING_CART_EMPTY'));
         return null;
     }
     $arOrder = array("ORDER_PRICE" => 0, "ORDER_WEIGHT" => 0, "CURRENCY" => CSaleLang::GetLangCurrency($siteId), "WEIGHT_UNIT" => htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', false, $siteId)), "WEIGHT_KOEF" => htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, $siteId)), "BASKET_ITEMS" => $arShoppingCart, "SITE_ID" => $siteId, "LID" => $siteId, "USER_ID" => $userId, "USE_VAT" => false, "VAT_RATE" => 0, "VAT_SUM" => 0, "DELIVERY_ID" => false);
     foreach ($arShoppingCart as $arShoppingCartItem) {
         if (array_key_exists('CUSTOM_PRICE', $arShoppingCartItem) && 'Y' == $arShoppingCartItem['CUSTOM_PRICE']) {
             $arShoppingCartItem['DISCOUNT_PRICE'] = $arShoppingCartItem['DEFAULT_PRICE'] - $arShoppingCartItem['PRICE'];
             if (0 > $arShoppingCartItem['DISCOUNT_PRICE']) {
                 $arShoppingCartItem['DISCOUNT_PRICE'] = 0;
             }
             $arShoppingCartItem['DISCOUNT_PRICE_PERCENT'] = $arShoppingCartItem['DISCOUNT_PRICE'] * 100 / $arShoppingCartItem['DEFAULT_PRICE'];
             if ($arShoppingCartItem["VAT_RATE"] > 0) {
                 $arShoppingCartItem["VAT_VALUE"] = $arShoppingCartItem["PRICE"] / ($arShoppingCartItem["VAT_RATE"] + 1) * $arShoppingCartItem["VAT_RATE"];
             }
         }
         $arOrder["ORDER_PRICE"] += $arShoppingCartItem["PRICE"] * $arShoppingCartItem["QUANTITY"];
         $arOrder["ORDER_WEIGHT"] += $arShoppingCartItem["WEIGHT"] * $arShoppingCartItem["QUANTITY"];
         if ($arShoppingCartItem["VAT_RATE"] > 0) {
             $arOrder["USE_VAT"] = true;
             if ($arShoppingCartItem["VAT_RATE"] > $arOrder["VAT_RATE"]) {
                 $arOrder["VAT_RATE"] = $arShoppingCartItem["VAT_RATE"];
             }
             $arOrder["VAT_SUM"] += $arShoppingCartItem["VAT_VALUE"] * $arShoppingCartItem["QUANTITY"];
         }
     }
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderShoppingCart", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     CSalePersonType::DoProcessOrder($arOrder, $personTypeId, $arErrors);
     if (count($arErrors) > 0) {
         return null;
     }
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderPersonType", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     CSaleOrderProps::DoProcessOrder($arOrder, $arOrderPropsValues, $arErrors, $arWarnings);
     if (count($arErrors) > 0) {
         return null;
     }
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderProps", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     CSaleDelivery::DoProcessOrder($arOrder, $deliveryId, $arErrors);
     if (count($arErrors) > 0) {
         return null;
     }
     $arOrder["PRICE_DELIVERY"] = $arOrder["DELIVERY_PRICE"];
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderDelivery", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     CSalePaySystem::DoProcessOrder($arOrder, $paySystemId, $arErrors);
     if (count($arErrors) > 0) {
         return null;
     }
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderPaySystem", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     if (!array_key_exists('CART_FIX', $arOptions) || 'Y' != $arOptions['CART_FIX']) {
         CSaleDiscount::DoProcessOrder($arOrder, $arOptions, $arErrors);
         if (count($arErrors) > 0) {
             return null;
         }
         foreach (GetModuleEvents("sale", "OnSaleCalculateOrderDiscount", true) as $arEvent) {
             ExecuteModuleEventEx($arEvent, array(&$arOrder));
         }
     }
     CSaleTax::DoProcessOrderBasket($arOrder, $arOptions, $arErrors);
     if (count($arErrors) > 0) {
         return null;
     }
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderShoppingCartTax", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     CSaleTax::DoProcessOrderDelivery($arOrder, $arOptions, $arErrors);
     if (count($arErrors) > 0) {
         return null;
     }
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrderDeliveryTax", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     $arOrder["PRICE"] = $arOrder["ORDER_PRICE"] + $arOrder["DELIVERY_PRICE"] + $arOrder["TAX_PRICE"] - $arOrder["DISCOUNT_PRICE"];
     $arOrder["TAX_VALUE"] = $arOrder["USE_VAT"] ? $arOrder["VAT_SUM"] : $arOrder["TAX_PRICE"];
     foreach (GetModuleEvents("sale", "OnSaleCalculateOrder", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array(&$arOrder));
     }
     return $arOrder;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:96,代码来源:order.php

示例10: foreach

         $val = $_REQUEST["FIELDS"][$f_ID]["BASE_RATE_CURRENCY"];
     } else {
         $val = $f_BASE_RATE_CURRENCY;
     }
 }
 $fieldEdit .= "<select name=\"FIELDS[" . $f_ID . "][BASE_RATE_CURRENCY]\">";
 foreach ($arCurrencies as $key => $value) {
     $fieldEdit .= "<option value=\"" . $key . "\"" . ($key == $val ? " selected" : "") . ">" . $value . "</option>";
 }
 $fieldEdit .= "</select>";
 $row->AddField("RATE", $fieldValue, $fieldEdit);
 if ($affiliatePlanType == "N") {
     $fieldValue = IntVal($f_MIN_PLAN_VALUE) . "&nbsp;" . GetMessage("SAP1_SHT");
 } else {
     if (!array_key_exists($f_SITE_ID, $arBaseLangCurrencies)) {
         $arBaseLangCurrencies[$f_SITE_ID] = CSaleLang::GetLangCurrency($f_SITE_ID);
     }
     $fieldValue = SaleFormatCurrency($f_MIN_PLAN_VALUE, $arBaseLangCurrencies[$f_SITE_ID]);
 }
 if ($row->VarsFromForm() && $_REQUEST["FIELDS"]) {
     $val = $_REQUEST["FIELDS"][$f_ID]["MIN_PLAN_VALUE"];
 } else {
     $val = $f_MIN_PLAN_VALUE;
 }
 $fieldEdit = "<input type=\"text\" name=\"FIELDS[" . $f_ID . "][MIN_PLAN_VALUE]\" value=\"" . htmlspecialcharsbx($val) . "\" size=\"7\"> ";
 $row->AddField("MIN_PLAN_VALUE", $fieldValue, $fieldEdit);
 $arActions = array();
 $arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("SAP1_UPDATE"), "ACTION" => $lAdmin->ActionRedirect("sale_affiliate_plan_edit.php?ID=" . $f_ID . "&lang=" . LANG . GetFilterParams("filter_") . ""), "DEFAULT" => true);
 if ($saleModulePermissions >= "W") {
     $arActions[] = array("SEPARATOR" => true);
     $arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("SAP1_DELETE"), "ACTION" => "if(confirm('" . GetMessage("SAP1_DELETE_CONF") . "')) " . $lAdmin->ActionDoGroup($f_ID, "delete"));
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:affiliate_plan.php

示例11: array

if (!isset($arParams["DISABLE_BASKET_REDIRECT"]) || 'Y' !== $arParams["DISABLE_BASKET_REDIRECT"]) {
    $arParams["DISABLE_BASKET_REDIRECT"] = "N";
}
$bUseAccountNumber = COption::GetOptionString("sale", "account_number_template", "") !== "" ? true : false;
$arResult = array("PERSON_TYPE" => array(), "PAY_SYSTEM" => array(), "ORDER_PROP" => array(), "DELIVERY" => array(), "TAX" => array(), "ERROR" => array(), "ORDER_PRICE" => 0, "ORDER_WEIGHT" => 0, "VATE_RATE" => 0, "VAT_SUM" => 0, "bUsingVat" => false, "BASKET_ITEMS" => array(), "BASE_LANG_CURRENCY" => CSaleLang::GetLangCurrency(SITE_ID), "WEIGHT_UNIT" => htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_unit', false, SITE_ID)), "WEIGHT_KOEF" => htmlspecialcharsbx(COption::GetOptionString('sale', 'weight_koef', 1, SITE_ID)), "TaxExempt" => array(), "DISCOUNT_PRICE" => 0, "DISCOUNT_PERCENT" => 0, "DELIVERY_PRICE" => 0, "TAX_PRICE" => 0, "PAYED_FROM_ACCOUNT_FORMATED" => false, "ORDER_TOTAL_PRICE_FORMATED" => false, "ORDER_WEIGHT_FORMATED" => false, "ORDER_PRICE_FORMATED" => false, "VAT_SUM_FORMATED" => false, "DELIVERY_SUM" => false, "DELIVERY_PROFILE_SUM" => false, "DELIVERY_PRICE_FORMATED" => false, "DISCOUNT_PERCENT_FORMATED" => false, "PAY_FROM_ACCOUNT" => false, "CURRENT_BUDGET_FORMATED" => false, "USER_ACCOUNT" => false, "DISCOUNTS" => array(), "AUTH" => array(), "HAVE_PREPAYMENT" => false, "PREPAY_PS" => array(), "PREPAY_ADIT_FIELDS" => "", "PREPAY_ORDER_PROPS" => array());
$arUserResult = array("PERSON_TYPE_ID" => false, "PAY_SYSTEM_ID" => false, "DELIVERY_ID" => false, "ORDER_PROP" => false, "DELIVERY_LOCATION" => false, "TAX_LOCATION" => false, "PAYER_NAME" => false, "USER_EMAIL" => false, "PROFILE_NAME" => false, "PAY_CURRENT_ACCOUNT" => false, "CONFIRM_ORDER" => false, "FINAL_STEP" => false, "ORDER_DESCRIPTION" => false, "PROFILE_ID" => false, "PROFILE_CHANGE" => false, "DELIVERY_LOCATION_ZIP" => false);
$arResult["DELIVERY_EXTRA"] = isset($_POST["DELIVERY_ID"]) && isset($_POST["DELIVERY_EXTRA"][$_POST["DELIVERY_ID"]]) ? $_POST["DELIVERY_EXTRA"][$_POST["DELIVERY_ID"]] : array();
$arResult["AUTH"]["new_user_registration_email_confirmation"] = COption::GetOptionString("main", "new_user_registration_email_confirmation", "N") == "Y" ? "Y" : "N";
$arResult["AUTH"]["new_user_registration"] = COption::GetOptionString("main", "new_user_registration", "Y") == "Y" ? "Y" : "N";
$arParams["ALLOW_AUTO_REGISTER"] = $arParams["ALLOW_AUTO_REGISTER"] == "Y" ? "Y" : "N";
if ($arParams["ALLOW_AUTO_REGISTER"] == "Y" && ($arResult["AUTH"]["new_user_registration_email_confirmation"] == "Y" || $arResult["AUTH"]["new_user_registration"] == "N")) {
    $arParams["ALLOW_AUTO_REGISTER"] = "N";
}
$arParams["SEND_NEW_USER_NOTIFY"] = $arParams["SEND_NEW_USER_NOTIFY"] == "N" ? "N" : "Y";
$arParams["ALLOW_NEW_PROFILE"] = $arParams["ALLOW_NEW_PROFILE"] == "N" ? "N" : "Y";
$allCurrency = CSaleLang::GetLangCurrency(SITE_ID);
if (!$arParams["DELIVERY_NO_SESSION"]) {
    $arParams["DELIVERY_NO_SESSION"] = "N";
}
$arResult["BUYER_STORE"] = "";
if (isset($_POST["BUYER_STORE"])) {
    $arResult["BUYER_STORE"] = intval($_POST["BUYER_STORE"]);
}
$arResult["GRID"]["HEADERS"] = array();
$arResult["GRID"]["ROWS"] = array();
// grid product table columns
$bIblockEnabled = false;
$arResult["GRID"]["DEFAULT_COLUMNS"] = false;
if (empty($arParams["PRODUCT_COLUMNS"])) {
    $arParams["PRODUCT_COLUMNS"] = array("NAME" => GetMessage("SOA_NAME_DEFAULT_COLUMN"), "PROPS" => GetMessage("SOA_PROPS_DEFAULT_COLUMN"), "DISCOUNT_PRICE_PERCENT_FORMATED" => GetMessage("SOA_DISCOUNT_DEFAULT_COLUMN"), "PRICE_FORMATED" => GetMessage("SOA_PRICE_DEFAULT_COLUMN"), "QUANTITY" => GetMessage("SOA_QUANTITY_DEFAULT_COLUMN"), "SUM" => GetMessage("SOA_SUM_DEFAULT_COLUMN"));
    $arResult["GRID"]["DEFAULT_COLUMNS"] = true;
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:31,代码来源:component.php

示例12: header

             $arResponse = $result;
         }
     }
     header("Content-Type: application/x-javascript; charset=" . LANG_CHARSET);
     echo CUtil::PhpToJSObject($arResponse);
     exit;
 }
 // </editor-fold>
 if (!isset($arParams['F_SALE_SITE'])) {
     $arParams['F_SALE_SITE'] = CBaseSaleReportHelper::getDefaultSiteId();
 }
 // Select report currency
 $siteId = CBaseSaleReportHelper::getDefaultSiteId();
 $siteCurrencyId = '';
 if ($siteId !== null) {
     $arCurr = \CSaleLang::GetByID($siteId);
     if (!empty($arCurr['CURRENCY'])) {
         $siteCurrencyId = $arCurr['CURRENCY'];
     }
 }
 if (empty($siteCurrencyId)) {
     $siteCurrencyId = \COption::GetOptionString('sale', 'default_currency', null, $siteId !== null ? $siteId : false);
 }
 CBaseSaleReportHelper::setSiteCurrencyId($siteCurrencyId);
 $reportCurrencyId = $siteCurrencyId;
 if (isset($_REQUEST['F_SALE_CURRENCY'])) {
     $currenciesIds = array_keys(CBaseSaleReportHelper::getCurrencies());
     if (in_array($_REQUEST['F_SALE_CURRENCY'], $currenciesIds, true)) {
         $reportCurrencyId = $_REQUEST['F_SALE_CURRENCY'];
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:report_view_prepdata.php

示例13: nodeHandler


//.........这里部分代码省略.........
							}
						}

						if(IntVal($arOrder["PERSON_TYPE_ID"]) <= 0)
						{
							foreach($this->arExportInfo as $pt => $value)
							{
								if(
									(($value["IS_FIZ"] == "Y" && $arOrder["AGENT"]["TYPE"] == "FIZ")
									|| ($value["IS_FIZ"] == "N" && $arOrder["AGENT"]["TYPE"] != "FIZ"))
									)
									$arOrder["PERSON_TYPE_ID"] = $pt;
							}
						}

						if(IntVal($arOrder["PERSON_TYPE_ID"]) > 0)
						{
							$arAgent = $this->arExportInfo[$arOrder["PERSON_TYPE_ID"]];
							foreach($arAgent as $k => $v)
							{
								if((strlen($v["VALUE"]) <= 0 || $v["TYPE"] != "PROPERTY") && (empty($arOrder["USER_PROPS"]) || empty($arOrder["USER_PROPS"][$v["VALUE"]])))
									unset($arAgent[$k]);
							}

							if(IntVal($arOrder["USER_ID"]) > 0)
							{
								$orderFields = array(
									"SITE_ID" => $this->arParams["SITE_NEW_ORDERS"],
									"PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"],
									"PAYED" => "N",
									"CANCELED" => "N",
									"STATUS_ID" => "N",
									"PRICE" => $arOrder["AMOUNT"],
									"CURRENCY" => CSaleLang::GetLangCurrency($this->arParams["SITE_NEW_ORDERS"]),
									"USER_ID" => $arOrder["USER_ID"],
									"TAX_VALUE" => doubleval($arOrder["TAX"]["VALUE_MONEY"]),
									"COMMENTS" => $arOrder["COMMENT"],
									"BASKET_ITEMS" => array(),
									"TAX_LIST" => array(),
									"ORDER_PROP" => array(),
								);
								$arAditFields = array(
									"EXTERNAL_ORDER" => "Y",
									"ID_1C" => $arOrder["ID_1C"],
									"VERSION_1C" => $arOrder["VERSION_1C"],
									"UPDATED_1C" => "Y",
									"DATE_INSERT" => CDatabase::FormatDate($arOrder["DATE"]." ".$arOrder["TIME"], "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL", LANG)),
								);

								foreach($arOrder["items"] as $productID => $val)
								{
									$orderFields["BASKET_ITEMS"][] = $this->prepareProduct4Basket($productID, $val, false, $orderFields);
								}

								if(!empty($arOrder["TAX"]))
								{
									$orderFields["TAX_LIST"][] = array(
										"NAME" => $arOrder["TAX"]["NAME"],
										"IS_PERCENT" => "Y",
										"VALUE" => $arOrder["TAX"]["VALUE"],
										"VALUE_MONEY" => $arOrder["TAX"]["VALUE_MONEY"],
										"IS_IN_PRICE" => $arOrder["TAX"]["IS_IN_PRICE"],
									);
								}

								foreach($arAgent as $k => $v)
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:67,代码来源:order_loader.php

示例14: CheckFields


//.........这里部分代码省略.........
     if ($ACTION != 'ADD') {
         $existPrice = array_key_exists('PRICE', $arFields);
         $existCurrency = array_key_exists('CURRENCY', $arFields) && (string) $arFields['CURRENCY'] != '';
         if (!$existPrice || !$existCurrency) {
             $existSiteId = isset($arFields['LID']) && (string) $arFields['LID'] != '';
             if (!$existSiteId) {
                 $select = array('ID', 'LID');
                 if (!$existPrice) {
                     $select[] = 'PRICE';
                 }
                 if (!$existCurrency) {
                     $select[] = 'CURRENCY';
                 }
                 $basketIterator = CSaleBasket::GetList(array(), array('ID' => $ID), false, false, $select);
                 if ($basket = $basketIterator->Fetch()) {
                     if (!$existSiteId) {
                         $arFields['LID'] = $basket['LID'];
                     }
                     if (!$existPrice) {
                         $arFields['PRICE'] = $basket['PRICE'];
                     }
                     if (!$existCurrency) {
                         $arFields['CURRENCY'] = $basket['CURRENCY'];
                     }
                 }
                 unset($basket, $basketIterator, $select);
             }
             unset($existSiteId);
         }
         unset($existCurrency, $existPrice);
     }
     if (!empty($arFields['LID']) && !empty($arFields['CURRENCY'])) {
         if (!isset(self::$currencySiteList[$arFields['LID']])) {
             self::$currencySiteList[$arFields['LID']] = CSaleLang::GetLangCurrency($arFields['LID']);
         }
         $siteCurrency = self::$currencySiteList[$arFields['LID']];
         if ($siteCurrency != $arFields['CURRENCY']) {
             $arFields["PRICE"] = roundEx(CCurrencyRates::ConvertCurrency($arFields["PRICE"], $arFields["CURRENCY"], $siteCurrency), SALE_VALUE_PRECISION);
             if (is_set($arFields, "DISCOUNT_PRICE")) {
                 $arFields["DISCOUNT_PRICE"] = roundEx(CCurrencyRates::ConvertCurrency($arFields["DISCOUNT_PRICE"], $arFields["CURRENCY"], $siteCurrency), SALE_VALUE_PRECISION);
             }
             $arFields["CURRENCY"] = $siteCurrency;
         }
         unset($siteCurrency);
     }
     // Changed by Sigurd, 2007-08-16
     if (is_set($arFields, "QUANTITY")) {
         $arFields["QUANTITY"] = floatval($arFields["QUANTITY"]);
     }
     if ((is_set($arFields, "QUANTITY") || $ACTION == "ADD") && floatval($arFields["QUANTITY"]) <= 0) {
         $arFields["QUANTITY"] = 1;
     }
     if (is_set($arFields, "DELAY") && $arFields["DELAY"] != "Y") {
         $arFields["DELAY"] = "N";
     }
     if (is_set($arFields, "CAN_BUY") && $arFields["CAN_BUY"] != "Y") {
         $arFields["CAN_BUY"] = "N";
     }
     if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
         $APPLICATION->ThrowException(Loc::getMessage('BT_MOD_SALE_BASKET_ERR_NAME_ABSENT'), "NAME");
         return false;
     }
     if ($ACTION == "ADD" && !is_set($arFields, "FUSER_ID")) {
         $arFields["FUSER_ID"] = CSaleBasket::GetBasketUserID(false);
     }
     if ((is_set($arFields, "FUSER_ID") || $ACTION == "ADD") && IntVal($arFields["FUSER_ID"]) <= 0) {
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:67,代码来源:basket.php

示例15: GetMessage

 if ($PERSON_TYPE_ID > 0 && !($arPersonType = CSalePersonType::GetByID($PERSON_TYPE_ID))) {
     $errorMessage .= GetMessage("SOE_PERSON_NOT_FOUND") . "<br>";
 }
 $STATUS_ID = Trim($STATUS_ID);
 if (strlen($STATUS_ID) > 0) {
     if ($saleModulePermissions < "W") {
         $dbStatusList = CSaleStatus::GetList(array(), array("GROUP_ID" => $GLOBALS["USER"]->GetUserGroupArray(), "PERM_STATUS" => "Y", "ID" => $STATUS_ID), array("ID", "MAX" => "PERM_STATUS"), false, array("ID"));
         if (!$dbStatusList->Fetch()) {
             $errorMessage .= str_replace("#STATUS_ID#", $STATUS_ID, GetMessage("SOE_NO_STATUS_PERMS")) . ". ";
         }
     }
 }
 $CANCELED = $CANCELED == "Y" ? "Y" : "N";
 $PAYED = $PAYED == "Y" ? "Y" : "N";
 $ALLOW_DELIVERY = $ALLOW_DELIVERY == "Y" ? "Y" : "N";
 $BASE_LANG_CURRENCY = CSaleLang::GetLangCurrency($LID);
 // Basket params
 $arBasketList = array();
 $arOrderPrice = array();
 $basketTotalPrice = 0;
 $arOrderWeight = array();
 $basketTotalWeight = 0;
 $arInd = array();
 $ids = array();
 $allIDs = array();
 $arIDs = explode(",", trim($_POST["BASKET_IDS"]));
 foreach ($arIDs as $v) {
     if ($_POST["product_delete_" . $v] != "Y") {
         $ids[] = $v;
     }
     $allIDs[] = $v;
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:order_edit.php


注:本文中的CSaleLang类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。