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


PHP CCatalogDiscountSave::Enable方法代码示例

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


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

示例1: PreGenerateExport

 function PreGenerateExport($profile_id)
 {
     global $DB;
     $profile_id = intval($profile_id);
     if ($profile_id <= 0) {
         return false;
     }
     $ar_profile = CCatalogExport::GetByID($profile_id);
     if (!$ar_profile || 'Y' == $ar_profile['NEED_EDIT']) {
         return false;
     }
     if ($ar_profile["DEFAULT_PROFILE"] != "Y") {
         parse_str($ar_profile["SETUP_VARS"]);
     }
     CCatalogDiscountSave::Disable();
     $strFile = CATALOG_PATH2EXPORTS . $ar_profile["FILE_NAME"] . "_run.php";
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
         $strFile = CATALOG_PATH2EXPORTS_DEF . $ar_profile["FILE_NAME"] . "_run.php";
         if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
             return false;
         }
     }
     @(include $_SERVER["DOCUMENT_ROOT"] . $strFile);
     CCatalogDiscountSave::Enable();
     CCatalogExport::Update($profile_id, array("=LAST_USE" => $DB->GetNowFunction()));
     return "CCatalogExport::PreGenerateExport(" . $profile_id . ");";
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:27,代码来源:catalog_export.php

示例2: PreGenerateImport

 public static function PreGenerateImport($profile_id)
 {
     global $DB;
     $profile_id = (int) $profile_id;
     if ($profile_id <= 0) {
         return false;
     }
     $ar_profile = CCatalogImport::GetByID($profile_id);
     if (!$ar_profile || 'Y' == $ar_profile['NEED_EDIT']) {
         return false;
     }
     $strFile = CATALOG_PATH2IMPORTS . $ar_profile["FILE_NAME"] . "_run.php";
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
         $strFile = CATALOG_PATH2IMPORTS_DEF . $ar_profile["FILE_NAME"] . "_run.php";
         if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
             CCatalogDiscountSave::Enable();
             return false;
         }
     }
     $bFirstLoadStep = true;
     if (!defined("CATALOG_LOAD_NO_STEP")) {
         define("CATALOG_LOAD_NO_STEP", true);
     }
     $strImportErrorMessage = "";
     $strImportOKMessage = "";
     $bAllDataLoaded = true;
     $arSetupVars = array();
     $intSetupVarsCount = 0;
     if ('Y' != $ar_profile["DEFAULT_PROFILE"]) {
         parse_str($ar_profile["SETUP_VARS"], $arSetupVars);
         if (!empty($arSetupVars) && is_array($arSetupVars)) {
             $intSetupVarsCount = extract($arSetupVars, EXTR_SKIP);
         }
     }
     global $arCatalogAvailProdFields;
     $arCatalogAvailProdFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_ELEMENT);
     global $arCatalogAvailPriceFields;
     $arCatalogAvailPriceFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_CATALOG);
     global $arCatalogAvailValueFields;
     $arCatalogAvailValueFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE);
     global $arCatalogAvailQuantityFields;
     $arCatalogAvailQuantityFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_PRICE_EXT);
     global $arCatalogAvailGroupFields;
     $arCatalogAvailGroupFields = CCatalogCSVSettings::getSettingsFields(CCatalogCSVSettings::FIELDS_SECTION);
     global $defCatalogAvailProdFields;
     $defCatalogAvailProdFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_ELEMENT);
     global $defCatalogAvailPriceFields;
     $defCatalogAvailPriceFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CATALOG);
     global $defCatalogAvailValueFields;
     $defCatalogAvailValueFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE);
     global $defCatalogAvailQuantityFields;
     $defCatalogAvailQuantityFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_PRICE_EXT);
     global $defCatalogAvailGroupFields;
     $defCatalogAvailGroupFields = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_SECTION);
     global $defCatalogAvailCurrencies;
     $defCatalogAvailCurrencies = CCatalogCSVSettings::getDefaultSettings(CCatalogCSVSettings::FIELDS_CURRENCY);
     CCatalogDiscountSave::Disable();
     include $_SERVER["DOCUMENT_ROOT"] . $strFile;
     CCatalogDiscountSave::Enable();
     CCatalogImport::Update($profile_id, array("=LAST_USE" => $DB->GetNowFunction()));
     return "CCatalogImport::PreGenerateImport(" . $profile_id . ");";
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:62,代码来源:catalog_import.php

示例3: unset

                    }
                    if ($res != "") {
                        $v .= ($v != '' ? ' / ' : '') . $res;
                    }
                }
                if ($v != "") {
                    $row->AddViewField("PROPERTY_" . $aProp['ID'], $v);
                }
                unset($arSelectedProps[$aProp['ID']]["CACHE"]);
            }
            foreach ($arPrices as $price) {
                $row->AddViewField("PRICE" . $price['ID'], $arPricesResult[$price['ID']][$arItems["ID"]]);
            }
        }
    }
    CCatalogDiscountSave::Enable();
    $lAdmin->BeginEpilogContent();
    ?>
	<script type="text/javascript">
	<?php 
    if (!empty($arSku)) {
        foreach ($arSku as $k => $v) {
            ?>
			if(BX('sku-<?php 
            echo $v;
            ?>
'))
				BX.hide(BX('sku-<?php 
            echo $v;
            ?>
').parentNode.parentNode);
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:cat_store_product_search.php

示例4: CatalogGetPriceTable

function CatalogGetPriceTable($ID)
{
    global $USER;
    $ID = (int) $ID;
    if ($ID <= 0) {
        return false;
    }
    $arResult = array();
    $arPriceGroups = array();
    $cacheKey = LANGUAGE_ID . "_" . $USER->GetGroups();
    if (isset($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"]) && is_array($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"]) && isset($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey]) && is_array($GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey])) {
        $arPriceGroups = $GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey];
    } else {
        $dbPriceGroupsList = CCatalogGroup::GetList(array("SORT" => "ASC"), array("CAN_ACCESS" => "Y", "LID" => LANGUAGE_ID), array("ID", "NAME_LANG", "SORT"), false, array("ID", "NAME_LANG", "CAN_BUY", "SORT"));
        while ($arPriceGroupsList = $dbPriceGroupsList->Fetch()) {
            $arPriceGroups[] = $arPriceGroupsList;
            $GLOBALS["CATALOG_PRICE_GROUPS_CACHE"][$cacheKey][] = $arPriceGroupsList;
        }
    }
    if (empty($arPriceGroups)) {
        return false;
    }
    $arBorderMap = array();
    $arPresentGroups = array();
    $bMultiQuantity = False;
    $dbPrice = CPrice::GetList(array("QUANTITY_FROM" => "ASC", "QUANTITY_TO" => "ASC", "SORT" => "ASC"), array("PRODUCT_ID" => $ID), false, false, array("ID", "CATALOG_GROUP_ID", "PRICE", "CURRENCY", "QUANTITY_FROM", "QUANTITY_TO", "ELEMENT_IBLOCK_ID", "SORT"));
    while ($arPrice = $dbPrice->Fetch()) {
        CCatalogDiscountSave::Disable();
        $arDiscounts = CCatalogDiscount::GetDiscount($ID, $arPrice["ELEMENT_IBLOCK_ID"], $arPrice["CATALOG_GROUP_ID"], $USER->GetUserGroupArray(), "N", SITE_ID, array());
        CCatalogDiscountSave::Enable();
        $discountPrice = CCatalogProduct::CountPriceWithDiscount($arPrice["PRICE"], $arPrice["CURRENCY"], $arDiscounts);
        $arPrice["DISCOUNT_PRICE"] = $discountPrice;
        if (array_key_exists($arPrice["QUANTITY_FROM"] . "-" . $arPrice["QUANTITY_TO"], $arBorderMap)) {
            $jnd = $arBorderMap[$arPrice["QUANTITY_FROM"] . "-" . $arPrice["QUANTITY_TO"]];
        } else {
            $jnd = count($arBorderMap);
            $arBorderMap[$arPrice["QUANTITY_FROM"] . "-" . $arPrice["QUANTITY_TO"]] = $jnd;
        }
        $arResult[$jnd]["QUANTITY_FROM"] = DoubleVal($arPrice["QUANTITY_FROM"]);
        $arResult[$jnd]["QUANTITY_TO"] = DoubleVal($arPrice["QUANTITY_TO"]);
        if (DoubleVal($arPrice["QUANTITY_FROM"]) > 0 || DoubleVal($arPrice["QUANTITY_TO"]) > 0) {
            $bMultiQuantity = True;
        }
        $arResult[$jnd]["PRICE"][$arPrice["CATALOG_GROUP_ID"]] = $arPrice;
    }
    $numGroups = count($arPriceGroups);
    for ($i = 0; $i < $numGroups; $i++) {
        $bNeedKill = True;
        for ($j = 0, $intCount = count($arResult); $j < $intCount; $j++) {
            if (!array_key_exists($arPriceGroups[$i]["ID"], $arResult[$j]["PRICE"])) {
                $arResult[$j]["PRICE"][$arPriceGroups[$i]["ID"]] = False;
            }
            if ($arResult[$j]["PRICE"][$arPriceGroups[$i]["ID"]] != false) {
                $bNeedKill = False;
            }
        }
        if ($bNeedKill) {
            for ($j = 0, $intCount = count($arResult); $j < $intCount; $j++) {
                unset($arResult[$j]["PRICE"][$arPriceGroups[$i]["ID"]]);
            }
            unset($arPriceGroups[$i]);
        }
    }
    return array("COLS" => $arPriceGroups, "MATRIX" => $arResult, "MULTI_QUANTITY" => $bMultiQuantity ? "Y" : "N");
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:65,代码来源:include.php

示例5: GetProductData


//.........这里部分代码省略.........
         if ($arParams['CHECK_COUPONS'] == 'Y') {
             $arCoupons = DiscountCouponsManager::getForApply(array(), $productHash, true);
             if (!empty($arCoupons)) {
                 $arCoupons = array_keys($arCoupons);
             }
         }
         if ($adminSection) {
             if ($intUserID > 0) {
                 CCatalogDiscountSave::SetDiscountUserID($intUserID);
             } else {
                 CCatalogDiscountSave::Disable();
             }
         }
         $currentVatMode = CCatalogProduct::getPriceVatIncludeMode();
         $currentUseDiscount = CCatalogProduct::getUseDiscount();
         CCatalogProduct::setUseDiscount($arParams['CHECK_DISCOUNT'] == 'Y');
         CCatalogProduct::setPriceVatIncludeMode(true);
         CCatalogProduct::setUsedCurrency($arParams['CURRENCY']);
         $arPrice = CCatalogProduct::GetOptimalPrice($productID, $quantity, $userGroups, $arParams['RENEWAL'], array(), $adminSection ? $strSiteID : false, $arCoupons);
         if (empty($arPrice)) {
             if ($nearestQuantity = CCatalogProduct::GetNearestQuantityPrice($productID, $quantity, $userGroups)) {
                 $quantity = $nearestQuantity;
                 $arPrice = CCatalogProduct::GetOptimalPrice($productID, $quantity, $userGroups, $arParams['RENEWAL'], array(), $adminSection ? $strSiteID : false, $arCoupons);
             }
         }
         CCatalogProduct::clearUsedCurrency();
         CCatalogProduct::setPriceVatIncludeMode($currentVatMode);
         CCatalogProduct::setUseDiscount($currentUseDiscount);
         unset($userGroups, $currentUseDiscount, $currentVatMode);
         if ($adminSection) {
             if ($intUserID > 0) {
                 CCatalogDiscountSave::ClearDiscountUserID();
             } else {
                 CCatalogDiscountSave::Enable();
             }
         }
         if (empty($arPrice)) {
             return $arResult;
         }
         $arDiscountList = array();
         if (empty($arPrice['DISCOUNT_LIST']) && !empty($arPrice['DISCOUNT']) && is_array($arPrice['DISCOUNT'])) {
             $arPrice['DISCOUNT_LIST'] = array($arPrice['DISCOUNT']);
         }
         if (!empty($arPrice['DISCOUNT_LIST'])) {
             $appliedCoupons = array();
             foreach ($arPrice['DISCOUNT_LIST'] as &$arOneDiscount) {
                 $arOneList = array('ID' => $arOneDiscount['ID'], 'NAME' => $arOneDiscount['NAME'], 'COUPON' => '', 'COUPON_TYPE' => '', 'USE_COUPONS' => isset($arOneDiscount['USE_COUPONS']) ? $arOneDiscount['USE_COUPONS'] : 'N', 'MODULE_ID' => isset($oneDiscount['MODULE_ID']) ? $oneDiscount['MODULE_ID'] : 'catalog', 'TYPE' => $arOneDiscount['TYPE'], 'VALUE' => $arOneDiscount['VALUE'], 'VALUE_TYPE' => $arOneDiscount['VALUE_TYPE'], 'MAX_VALUE' => $arOneDiscount['VALUE_TYPE'] == Catalog\DiscountTable::VALUE_TYPE_PERCENT ? $arOneDiscount['MAX_DISCOUNT'] : 0, 'CURRENCY' => $arOneDiscount['CURRENCY'], 'HANDLERS' => isset($arOneDiscount['HANDLERS']) ? $arOneDiscount['HANDLERS'] : array());
                 if (!empty($arOneDiscount['COUPON'])) {
                     $arOneList['USE_COUPONS'] = 'Y';
                     $arOneList['COUPON'] = $arOneDiscount['COUPON'];
                     $arOneList['COUPON_TYPE'] = $arOneDiscount['COUPON_ONE_TIME'];
                     $appliedCoupons[] = $arOneDiscount['COUPON'];
                 }
                 $arDiscountList[] = $arOneList;
             }
             unset($arOneList, $arOneDiscount);
             if (!empty($appliedCoupons)) {
                 $resultApply = DiscountCouponsManager::setApplyByProduct($productHash, $appliedCoupons);
             }
             unset($resultApply, $appliedCoupons);
         }
         if (empty($arPrice['PRICE']['CATALOG_GROUP_NAME'])) {
             if (!empty($arPrice['PRICE']['CATALOG_GROUP_ID'])) {
                 $priceName = self::getPriceTitle($arPrice['PRICE']['CATALOG_GROUP_ID']);
                 if ($priceName != '') {
                     $arPrice['PRICE']['CATALOG_GROUP_NAME'] = $priceName;
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:67,代码来源:product_provider.php

示例6: GetItemPrices


//.........这里部分代码省略.........
						$arPrices[$key]['PRINT_VALUE'] = $arPrices[$key]['PRINT_VALUE_VAT'];
						$arPrices[$key]['DISCOUNT_VALUE'] = $arPrices[$key]['DISCOUNT_VALUE_VAT'];
						$arPrices[$key]['PRINT_DISCOUNT_VALUE'] = $arPrices[$key]['PRINT_DISCOUNT_VALUE_VAT'];
					}
					else
					{
						$arPrices[$key]['VALUE'] = $arPrices[$key]['VALUE_NOVAT'];
						$arPrices[$key]['PRINT_VALUE'] = $arPrices[$key]['PRINT_VALUE_NOVAT'];
						$arPrices[$key]['DISCOUNT_VALUE'] = $arPrices[$key]['DISCOUNT_VALUE_NOVAT'];
						$arPrices[$key]['PRINT_DISCOUNT_VALUE'] = $arPrices[$key]['PRINT_DISCOUNT_VALUE_NOVAT'];
					}

					if (roundEx($arPrices[$key]['VALUE'], 2) == roundEx($arPrices[$key]['DISCOUNT_VALUE'], 2))
					{
						$arPrices[$key]['DISCOUNT_DIFF'] = 0;
						$arPrices[$key]['DISCOUNT_DIFF_PERCENT'] = 0;
						$arPrices[$key]['PRINT_DISCOUNT_DIFF'] = CCurrencyLang::CurrencyFormat(0, $arPrices[$key]['CURRENCY'], true);
					}
					else
					{
						$arPrices[$key]['DISCOUNT_DIFF'] = $arPrices[$key]['VALUE'] - $arPrices[$key]['DISCOUNT_VALUE'];
						$arPrices[$key]['DISCOUNT_DIFF_PERCENT'] = roundEx(100*$arPrices[$key]['DISCOUNT_DIFF']/$arPrices[$key]['VALUE'], 0);
						$arPrices[$key]['PRINT_DISCOUNT_DIFF'] = CCurrencyLang::CurrencyFormat($arPrices[$key]['DISCOUNT_DIFF'], $arPrices[$key]['CURRENCY'], true);
					}

					if ($value["CAN_VIEW"])
					{
						if ($boolStartMin)
						{
							$dblMinPrice = ($boolConvert || ($arPrices[$key]['CURRENCY'] == $strMinCurrency)
								? $arPrices[$key]['DISCOUNT_VALUE']
								: CCurrencyRates::ConvertCurrency($arPrices[$key]['DISCOUNT_VALUE'], $arPrices[$key]['CURRENCY'], $strMinCurrency)
							);
							$strMinCode = $key;
							$boolStartMin = false;
						}
						else
						{
							$dblComparePrice = ($boolConvert || ($arPrices[$key]['CURRENCY'] == $strMinCurrency)
								? $arPrices[$key]['DISCOUNT_VALUE']
								: CCurrencyRates::ConvertCurrency($arPrices[$key]['DISCOUNT_VALUE'], $arPrices[$key]['CURRENCY'], $strMinCurrency)
							);
							if ($dblMinPrice > $dblComparePrice)
							{
								$dblMinPrice = $dblComparePrice;
								$strMinCode = $key;
							}
						}
					}
				}
			}
			if ('' != $strMinCode)
				$arPrices[$strMinCode]['MIN_PRICE'] = 'Y';
			CCatalogDiscountSave::Enable();
		}
		else
		{
			$strMinCode = '';
			$boolStartMin = true;
			$dblMinPrice = 0;
			foreach($arCatalogPrices as $key => $value)
			{
				if($value["CAN_VIEW"])
				{
					$dblValue = round(doubleval($arItem["PROPERTY_".$value["ID"]."_VALUE"]), 2);
					if ($boolStartMin)
					{
						$dblMinPrice = $dblValue;
						$strMinCode = $key;
						$boolStartMin = false;
					}
					else
					{
						if ($dblMinPrice > $dblValue)
						{
							$dblMinPrice = $dblValue;
							$strMinCode = $key;
						}
					}
					$arPrices[$key] = array(
						"ID" => $arItem["PROPERTY_".$value["ID"]."_VALUE_ID"],
						"VALUE" => $dblValue,
						"PRINT_VALUE" => $dblValue." ".$arItem["PROPERTY_".$value["ID"]."_DESCRIPTION"],
						"DISCOUNT_VALUE" => $dblValue,
						"PRINT_DISCOUNT_VALUE" => $dblValue." ".$arItem["PROPERTY_".$value["ID"]."_DESCRIPTION"],
						"CURRENCY" => $arItem["PROPERTY_".$value["ID"]."_DESCRIPTION"],
						"CAN_ACCESS" => true,
						"CAN_BUY" => false,
						'DISCOUNT_DIFF_PERCENT' => 0,
						'DISCOUNT_DIFF' => 0,
						'PRINT_DISCOUNT_DIFF' => '0 '.$arItem["PROPERTY_".$value["ID"]."_DESCRIPTION"],
						"MIN_PRICE" => "N"
					);
				}
			}
			if ('' != $strMinCode)
				$arPrices[$strMinCode]['MIN_PRICE'] = 'Y';
		}
		return $arPrices;
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:101,代码来源:comp_pricetools.php

示例7: GetItemPrices

	public static function GetItemPrices($IBLOCK_ID, $arCatalogPrices, $arItem, $bVATInclude = true, $arCurrencyParams = array(), $USER_ID = 0, $LID = SITE_ID)
	{
		static $arCurUserGroups = array();

		global $USER;
		$arPrices = array();
		if(CModule::IncludeModule("catalog"))
		{
			$USER_ID = intval($USER_ID);
			$intUserID = $USER_ID;
			if (0 >= $intUserID)
				$intUserID = $USER->GetID();
			if (!array_key_exists($intUserID, $arCurUserGroups))
			{
				$arCurUserGroups[$intUserID] = (0 < $USER_ID ? CUser::GetUserGroup($USER_ID) : $USER->GetUserGroupArray());
			}
			$arUserGroups = $arCurUserGroups[$intUserID];

			$boolConvert = false;
			$strCurrencyID = '';
			if (is_array($arCurrencyParams) && !empty($arCurrencyParams) && !empty($arCurrencyParams['CURRENCY_ID']))
			{
				$boolConvert = true;
				$strCurrencyID = $arCurrencyParams['CURRENCY_ID'];
			}
			foreach($arCatalogPrices as $key => $value)
			{
				if($value["CAN_VIEW"] && strlen($arItem["CATALOG_PRICE_".$value["ID"]]) > 0)
				{
					// get final price with VAT included.
					if ($arItem['CATALOG_VAT_INCLUDED'] != 'Y')
					{
						$arItem['CATALOG_PRICE_'.$value['ID']] *= (1 + $arItem['CATALOG_VAT'] * 0.01);
					}
					CCatalogDiscountSave::Disable();
					// so discounts will include VAT
					$arDiscounts = CCatalogDiscount::GetDiscount(
						$arItem["ID"],
						$arItem["IBLOCK_ID"],
						array($value["ID"]),
						$arUserGroups,
						"N",
						$LID,
						array()
					);
					CCatalogDiscountSave::Enable();
					$discountPrice = CCatalogProduct::CountPriceWithDiscount(
						$arItem["CATALOG_PRICE_".$value["ID"]],
						$arItem["CATALOG_CURRENCY_".$value["ID"]],
						$arDiscounts
					);
					// get clear prices WO VAT
					$arItem['CATALOG_PRICE_'.$value['ID']] /= (1 + $arItem['CATALOG_VAT'] * 0.01);
					$discountPrice /= (1 + $arItem['CATALOG_VAT'] * 0.01);

					$vat_value_discount = $discountPrice * $arItem['CATALOG_VAT'] * 0.01;
					$vat_discountPrice = $discountPrice + $vat_value_discount;

					$vat_value = $arItem['CATALOG_PRICE_'.$value['ID']] * $arItem['CATALOG_VAT'] * 0.01;
					$vat_price = $arItem["CATALOG_PRICE_".$value["ID"]] + $vat_value;

					if ($boolConvert && $strCurrencyID != $arItem["CATALOG_CURRENCY_".$value["ID"]])
					{
						$strOrigCurrencyID = $arItem["CATALOG_CURRENCY_".$value["ID"]];
						$dblOrigNoVat = $arItem["CATALOG_PRICE_".$value["ID"]];
						$dblNoVat = CCurrencyRates::ConvertCurrency($dblOrigNoVat, $strOrigCurrencyID, $strCurrencyID);
						$dblVatPrice = CCurrencyRates::ConvertCurrency($vat_price, $strOrigCurrencyID, $strCurrencyID);
						$dblVatValue = CCurrencyRates::ConvertCurrency($vat_value, $strOrigCurrencyID, $strCurrencyID);
						$dblDiscountValueNoVat = CCurrencyRates::ConvertCurrency($discountPrice, $strOrigCurrencyID, $strCurrencyID);
						$dblVatDiscountPrice = CCurrencyRates::ConvertCurrency($vat_discountPrice, $strOrigCurrencyID, $strCurrencyID);
						$dblDiscountValueVat = CCurrencyRates::ConvertCurrency($vat_value_discount, $strOrigCurrencyID, $strCurrencyID);

						$arPrices[$key] = array(
							'ORIG_VALUE_NOVAT' => $dblOrigNoVat,
							"VALUE_NOVAT" => $dblNoVat,
							"PRINT_VALUE_NOVAT" => FormatCurrency($dblNoVat, $strCurrencyID),

							'ORIG_VALUE_VAT' => $vat_price,
							"VALUE_VAT" => $dblVatPrice,
							"PRINT_VALUE_VAT" => FormatCurrency($dblVatPrice, $strCurrencyID),

							'ORIG_VATRATE_VALUE' => $vat_value,
							"VATRATE_VALUE" => $dblVatValue,
							"PRINT_VATRATE_VALUE" => FormatCurrency($dblVatValue, $strCurrencyID),

							'ORIG_DISCOUNT_VALUE_NOVAT' => $discountPrice,
							"DISCOUNT_VALUE_NOVAT" => $dblDiscountValueNoVat,
							"PRINT_DISCOUNT_VALUE_NOVAT" => FormatCurrency($dblDiscountValueNoVat, $strCurrencyID),

							"ORIG_DISCOUNT_VALUE_VAT" => $vat_discountPrice,
							"DISCOUNT_VALUE_VAT" => $dblVatDiscountPrice,
							"PRINT_DISCOUNT_VALUE_VAT" => FormatCurrency($dblVatDiscountPrice, $strCurrencyID),

							'ORIG_DISCOUNT_VATRATE_VALUE' => $vat_value_discount,
							'DISCOUNT_VATRATE_VALUE' => $dblDiscountValueVat,
							'PRINT_DISCOUNT_VATRATE_VALUE' => FormatCurrency($dblDiscountValueVat, $strCurrencyID),

							'ORIG_CURRENCY' => $strOrigCurrencyID,
							"CURRENCY" => $strCurrencyID,
						);
//.........这里部分代码省略.........
开发者ID:nProfessor,项目名称:Mytb,代码行数:101,代码来源:comp_pricetools.php

示例8: PreGenerateImport

	/**
	 * <p>Метод выполняет профиль <i>profile_id</i> на агенте.</p>
	 *
	 *
	 *
	 *
	 * @param int $profile_id  Код выполняемого профиля.
	 *
	 *
	 *
	 * @return mixed <p>В случае успешного выполнения профиля импорта метод возвращает
	 * строку для следующего вызова агента. В противном случае метод
	 * вернет <i>false</i>.</p><br><br>
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogimport/pregenerateimport.php
	 * @author Bitrix
	 */
	public static function PreGenerateImport($profile_id)
	{
		global $DB;

		$profile_id = intval($profile_id);
		if ($profile_id <= 0)
			return false;

		$ar_profile = CCatalogImport::GetByID($profile_id);
		if ((!$ar_profile) || ('Y' == $ar_profile['NEED_EDIT']))
			return false;

		$strFile = CATALOG_PATH2IMPORTS.$ar_profile["FILE_NAME"]."_run.php";
		if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
		{
			$strFile = CATALOG_PATH2IMPORTS_DEF.$ar_profile["FILE_NAME"]."_run.php";
			if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
			{
				CCatalogDiscountSave::Enable();
				return false;
			}
		}

		$bFirstLoadStep = true;

		if (!defined("CATALOG_LOAD_NO_STEP"))
			// define("CATALOG_LOAD_NO_STEP", true);

		$strImportErrorMessage = "";
		$strImportOKMessage = "";

		$bAllDataLoaded = true;

		$arSetupVars = array();
		$intSetupVarsCount = 0;
		if ('Y' != $ar_profile["DEFAULT_PROFILE"])
		{
			parse_str($ar_profile["SETUP_VARS"], $arSetupVars);
			if (!empty($arSetupVars) && is_array($arSetupVars))
			{
				$intSetupVarsCount = extract($arSetupVars, EXTR_SKIP);
			}
		}

		CCatalogDiscountSave::Disable();
		include($_SERVER["DOCUMENT_ROOT"].$strFile);
		CCatalogDiscountSave::Enable();

		CCatalogImport::Update($profile_id, array(
			"=LAST_USE" => $DB->GetNowFunction()
			)
		);

		return "CCatalogImport::PreGenerateImport(".$profile_id.");";
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:73,代码来源:catalog_import.php

示例9: PreGenerateImport

 function PreGenerateImport($profile_id)
 {
     global $DB;
     $profile_id = IntVal($profile_id);
     if ($profile_id <= 0) {
         return false;
     }
     $ar_profile = CCatalogImport::GetByID($profile_id);
     if (!$ar_profile || 'Y' == $ar_profile['NEED_EDIT']) {
         return false;
     }
     if ($ar_profile["DEFAULT_PROFILE"] != "Y") {
         parse_str($ar_profile["SETUP_VARS"]);
     }
     $bFirstLoadStep = True;
     if (!defined("CATALOG_LOAD_NO_STEP")) {
         define("CATALOG_LOAD_NO_STEP", true);
     }
     CCatalogDiscountSave::Disable();
     $strFile = CATALOG_PATH2IMPORTS . $ar_profile["FILE_NAME"] . "_run.php";
     if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
         $strFile = CATALOG_PATH2IMPORTS_DEF . $ar_profile["FILE_NAME"] . "_run.php";
         if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $strFile)) {
             CCatalogDiscountSave::Enable();
             return false;
         }
     }
     $strImportErrorMessage = "";
     $strImportOKMessage = "";
     $bAllDataLoaded = True;
     @(include $_SERVER["DOCUMENT_ROOT"] . $strFile);
     CCatalogDiscountSave::Enable();
     CCatalogImport::Update($profile_id, array("=LAST_USE" => $DB->GetNowFunction()));
     return "CCatalogImport::PreGenerateImport(" . $profile_id . ");";
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:35,代码来源:catalog_import.php

示例10: PreGenerateExport

	/**
	 * <p>Метод выполняет профиль <i>profile_id</i> на агенте.</p>
	 *
	 *
	 *
	 *
	 * @param int $profile_id  Код выполняемого профиля.
	 *
	 *
	 *
	 * @return mixed <p>В случае успешного выполнения профиля экспорта метод
	 * возвращает строку для следующего вызова агента. В противном
	 * случае метод вернет <i>false</i>.</p><br><br>
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/catalog/classes/ccatalogexport/pregenerateexport.php
	 * @author Bitrix
	 */
	public static function PreGenerateExport($profile_id)
	{
		global $DB;

		$profile_id = intval($profile_id);
		if ($profile_id<=0) return false;

		$ar_profile = CCatalogExport::GetByID($profile_id);
		if ((!$ar_profile) || ('Y' == $ar_profile['NEED_EDIT']))
			return false;

		$strFile = CATALOG_PATH2EXPORTS.$ar_profile["FILE_NAME"]."_run.php";
		if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
		{
			$strFile = CATALOG_PATH2EXPORTS_DEF.$ar_profile["FILE_NAME"]."_run.php";
			if (!file_exists($_SERVER["DOCUMENT_ROOT"].$strFile))
			{
				return false;
			}
		}

		$arSetupVars = array();
		$intSetupVarsCount = 0;
		if ('Y' != $ar_profile["DEFAULT_PROFILE"])
		{
			parse_str($ar_profile["SETUP_VARS"], $arSetupVars);
			if (!empty($arSetupVars) && is_array($arSetupVars))
			{
				$intSetupVarsCount = extract($arSetupVars, EXTR_SKIP);
			}
		}

		CCatalogDiscountSave::Disable();
		include($_SERVER["DOCUMENT_ROOT"].$strFile);
		CCatalogDiscountSave::Enable();

		CCatalogExport::Update($profile_id, array(
			"=LAST_USE" => $DB->GetNowFunction()
			)
		);

		return "CCatalogExport::PreGenerateExport(".$profile_id.");";
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:61,代码来源:catalog_export.php


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