當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。