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