本文整理汇总了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);
示例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"])))
{
示例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),