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


PHP CCatalogMeasureRatio::add方法代码示例

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


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

示例1: intval

							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"])))
		{
			$CATALOG_PRICE = $_POST["CATALOG_PRICE"];
			$CATALOG_CURRENCY = $_POST["CATALOG_CURRENCY"];
			$CATALOG_EXTRA = $_POST["CATALOG_EXTRA"];
			$CATALOG_PRICE_ID = $_POST["CATALOG_PRICE_ID"];
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php

示例2: array

 CCatalogProduct::Add($arFields);
 $arMeasureRatio = array('PRODUCT_ID' => $PRODUCT_ID, 'RATIO' => $CAT_MEASURE_RATIO);
 $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>";
                 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:product_edit_action.php


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