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


PHP CCatalogMeasureRatio::update方法代码示例

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


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

示例1: array

 $newRatio = true;
 $currentRatioID = 0;
 if (isset($_POST['CAT_MEASURE_RATIO_ID'])) {
     $currentRatioID = (int) $_POST['CAT_MEASURE_RATIO_ID'];
     if ($currentRatioID > 0) {
         $ratioIterator = CCatalogMeasureRatio::getList(array(), array('ID' => $currentRatioID, 'PRODUCT_ID' => $PRODUCT_ID), false, false, array('ID', 'PRODUCT_ID'));
         if ($currentRatio = $ratioIterator->Fetch()) {
             $newRatio = false;
         }
         unset($currentRatio, $ratioIterator);
     }
 }
 if ($newRatio) {
     CCatalogMeasureRatio::add($arMeasureRatio);
 } else {
     CCatalogMeasureRatio::update($currentRatioID, $arMeasureRatio);
 }
 unset($currentRatioID, $newRatio, $arMeasureRatio);
 $intCountBasePrice = count($arCatalogBasePrices);
 for ($i = 0; $i < $intCountBasePrice; $i++) {
     if (strlen($arCatalogBasePrices[$i]["PRICE"]) > 0) {
         $arCatalogFields = array("EXTRA_ID" => false, "PRODUCT_ID" => $PRODUCT_ID, "CATALOG_GROUP_ID" => $arCatalogBaseGroup["ID"], "PRICE" => DoubleVal($arCatalogBasePrices[$i]["PRICE"]), "CURRENCY" => $arCatalogBasePrices[$i]["CURRENCY"], "QUANTITY_FROM" => $arCatalogBasePrices[$i]["QUANTITY_FROM"] > 0 ? $arCatalogBasePrices[$i]["QUANTITY_FROM"] : false, "QUANTITY_TO" => $arCatalogBasePrices[$i]["QUANTITY_TO"] > 0 ? $arCatalogBasePrices[$i]["QUANTITY_TO"] : false);
         if ($arCatalogBasePrices[$i]["ID"] > 0) {
             $arCatalogPrice = CPrice::GetByID($arCatalogBasePrices[$i]["ID"]);
             if ($arCatalogPrice && $arCatalogPrice["PRODUCT_ID"] == $PRODUCT_ID) {
                 $arUpdatedIDs[] = $arCatalogBasePrices[$i]["ID"];
                 if (!CPrice::Update($arCatalogBasePrices[$i]["ID"], $arCatalogFields)) {
                     $strWarning .= str_replace("#ID#", $arCatalogBasePrices[$i]["ID"], GetMessage("C2IT_ERROR_PRPARAMS")) . "<br>";
                 }
             } else {
                 $ID_tmp = CPrice::Add($arCatalogFields);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:product_edit_action.php

示例2: intval

					{
						$intRatioID = 0;
						$rsRatios = CCatalogMeasureRatio::getList(
							array(),
							array('PRODUCT_ID' => $ID),
							false,
							false,
							array('ID', 'PRODUCT_ID')
						);
						if ($arRatio = $rsRatios->Fetch())
						{
							$intRatioID = intval($arRatio['ID']);
						}
						if (0 < $intRatioID)
						{
							CCatalogMeasureRatio::update($intRatioID, array('RATIO' => trim($arFields['CATALOG_MEASURE_RATIO'])));
						}
						else
						{
							CCatalogMeasureRatio::add(array('PRODUCT_ID' => $ID, 'RATIO' => trim($arFields['CATALOG_MEASURE_RATIO'])));
						}
					}
				}
			}
		}
	}

	if($bCatalog)
	{
		if ($boolCatalogPrice && (isset($_POST["CATALOG_PRICE"]) || isset($_POST["CATALOG_CURRENCY"])))
		{
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php

示例3: array

				if($purchasingCurrency != '')
					$arFields["PURCHASING_CURRENCY"] = $purchasingCurrency;

				if ($arCatalog["SUBSCRIPTION"] == "Y")
				{
					$arFields["PRICE_TYPE"] = $CAT_PRICE_TYPE;
					$arFields["RECUR_SCHEME_TYPE"] = $CAT_RECUR_SCHEME_TYPE;
					$arFields["RECUR_SCHEME_LENGTH"] = $CAT_RECUR_SCHEME_LENGTH;
					$arFields["TRIAL_PRICE_ID"] = $CAT_TRIAL_PRICE_ID;
					$arFields["WITHOUT_ORDER"] = $CAT_WITHOUT_ORDER;
				}
				CCatalogProduct::Add($arFields);

				$arMeasureRatio = array("PRODUCT_ID" => $PRODUCT_ID, "RATIO" => $CAT_MEASURE_RATIO);
				if(isset($CAT_MEASURE_RATIO_ID) && intval($CAT_MEASURE_RATIO_ID) > 0)
					CCatalogMeasureRatio::update($CAT_MEASURE_RATIO_ID, $arMeasureRatio);
				else
					CCatalogMeasureRatio::add($arMeasureRatio);

				$intCountBasePrice = count($arCatalogBasePrices);
				for ($i = 0; $i < $intCountBasePrice; $i++)
				{
					if (strlen($arCatalogBasePrices[$i]["PRICE"]) > 0)
					{
						$arCatalogFields = array(
							"EXTRA_ID" => false,
							"PRODUCT_ID" => $PRODUCT_ID,
							"CATALOG_GROUP_ID" => $arCatalogBaseGroup["ID"],
							"PRICE" => DoubleVal($arCatalogBasePrices[$i]["PRICE"]),
							"CURRENCY" => $arCatalogBasePrices[$i]["CURRENCY"],
							"QUANTITY_FROM" => ($arCatalogBasePrices[$i]["QUANTITY_FROM"] > 0 ? $arCatalogBasePrices[$i]["QUANTITY_FROM"] : False),
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:product_edit_action.php


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