if ($boolCatalogPrice && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit_price")) { $arCatalogProduct = array(); if (isset($arFields['CATALOG_WEIGHT']) && '' != $arFields['CATALOG_WEIGHT']) $arCatalogProduct['WEIGHT'] = $arFields['CATALOG_WEIGHT']; if (isset($arFields['CATALOG_VAT_INCLUDED']) && !empty($arFields['CATALOG_VAT_INCLUDED'])) $arCatalogProduct['VAT_INCLUDED'] = $arFields['CATALOG_VAT_INCLUDED']; if (isset($arFields['CATALOG_QUANTITY_TRACE']) && !empty($arFields['CATALOG_QUANTITY_TRACE'])) $arCatalogProduct['QUANTITY_TRACE'] = $arFields['CATALOG_QUANTITY_TRACE']; if ('Y' != $strUseStoreControl) { if (isset($arFields['CATALOG_QUANTITY']) && '' != $arFields['CATALOG_QUANTITY']) $arCatalogProduct['QUANTITY'] = $arFields['CATALOG_QUANTITY']; } if (!CCatalogProduct::IsExistProduct($ID)) { $arCatalogProduct['ID'] = $ID; CCatalogProduct::Add($arCatalogProduct, false); } else { if (!empty($arCatalogProduct)) CCatalogProduct::Update($ID, $arCatalogProduct); } if (isset($arFields['CATALOG_MEASURE_RATIO']) && '' != trim($arFields['CATALOG_MEASURE_RATIO'])) { $intRatioID = 0; $rsRatios = CCatalogMeasureRatio::getList( array(),
if ( $boolCatalogPrice && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit_price") ) { $arCatalogProduct = array(); if (isset($arFields['CATALOG_WEIGHT']) && '' != $arFields['CATALOG_WEIGHT']) $arCatalogProduct['WEIGHT'] = $arFields['CATALOG_WEIGHT']; if (isset($arFields['CATALOG_VAT_INCLUDED']) && !empty($arFields['CATALOG_VAT_INCLUDED'])) $arCatalogProduct['VAT_INCLUDED'] = $arFields['CATALOG_VAT_INCLUDED']; if (isset($arFields['CATALOG_QUANTITY_TRACE']) && !empty($arFields['CATALOG_QUANTITY_TRACE'])) $arCatalogProduct['QUANTITY_TRACE'] = $arFields['CATALOG_QUANTITY_TRACE']; if ('Y' != $strUseStoreControl) { if (isset($arFields['CATALOG_QUANTITY']) && '' != $arFields['CATALOG_QUANTITY']) $arCatalogProduct['QUANTITY'] = $arFields['CATALOG_QUANTITY']; } $boolProductExists = ($boolMethodExist ? CCatalogProduct::IsExistProduct($ID) : CCatalogProduct::GetByID($ID) ); if (!$boolProductExists) { $arCatalogProduct['ID'] = $ID; CCatalogProduct::Add($arCatalogProduct, false); } else { if (!empty($arCatalogProduct)) CCatalogProduct::Update($ID, $arCatalogProduct); } if (isset($arFields['CATALOG_MEASURE_RATIO']) && '' != trim($arFields['CATALOG_MEASURE_RATIO'])) { $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 ('' == $strWarning && $bCatalog) { $arCatalogItem = array( 'IBLOCK_ID' => $IBLOCK_ID, 'SECTION_ID' => $MENU_SECTION_ID, 'ID' => $ID, 'PRODUCT_ID' => CIBlockElement::GetRealElement($ID) ); if ($arShowTabs['catalog']) { include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/catalog/admin/templates/product_edit_action.php"); } elseif ($arShowTabs['sku']) { if (!CCatalogProduct::IsExistProduct($arCatalogItem['PRODUCT_ID'])) { $arEmptyProduct = array( 'ID' => $arCatalogItem['PRODUCT_ID'], 'QUANTITY' => 0, 'QUANTITY_TRACE' => 'N', 'CAN_BUY_ZERO' => 'N', 'NEGATIVE_AMOUNT_TRACE' => 'N', 'TYPE' => CCatalogProduct::TYPE_SKU ); CCatalogProduct::Add($arEmptyProduct, false); } } if ($arShowTabs['product_set']) { CCatalogAdminProductSetEdit::setProductFormParams(array('TYPE' => CCatalogProductSet::TYPE_SET));
{ $arCatalogProduct = array(); if (isset($arFields['CATALOG_WEIGHT']) && '' != $arFields['CATALOG_WEIGHT']) $arCatalogProduct['WEIGHT'] = $arFields['CATALOG_WEIGHT']; if (isset($arFields['CATALOG_VAT_INCLUDED']) && !empty($arFields['CATALOG_VAT_INCLUDED'])) $arCatalogProduct['VAT_INCLUDED'] = $arFields['CATALOG_VAT_INCLUDED']; if (isset($arFields['CATALOG_QUANTITY_TRACE']) && !empty($arFields['CATALOG_QUANTITY_TRACE'])) $arCatalogProduct['QUANTITY_TRACE'] = $arFields['CATALOG_QUANTITY_TRACE']; if ('Y' != $strUseStoreControl) { if (isset($arFields['CATALOG_QUANTITY']) && '' != $arFields['CATALOG_QUANTITY']) $arCatalogProduct['QUANTITY'] = $arFields['CATALOG_QUANTITY']; } $boolProductExists = ($boolMethodExist ? CCatalogProduct::IsExistProduct($subID) : CCatalogProduct::GetByID($subID) ); if (!$boolProductExists) { $arCatalogProduct['ID'] = $subID; CCatalogProduct::Add($arCatalogProduct, false); } else { if (!empty($arCatalogProduct)) CCatalogProduct::Update($subID, $arCatalogProduct); } if (isset($arFields['CATALOG_MEASURE_RATIO']) && '' != trim($arFields['CATALOG_MEASURE_RATIO'])) { $intRatioID = 0;