本文整理汇总了PHP中CCatalogProductSet::disableShowErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogProductSet::disableShowErrors方法的具体用法?PHP CCatalogProductSet::disableShowErrors怎么用?PHP CCatalogProductSet::disableShowErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogProductSet
的用法示例。
在下文中一共展示了CCatalogProductSet::disableShowErrors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkFormValues
public static function checkFormValues($arItem)
{
self::$arErrors = array();
$boolFeatureSet = CBXFeatures::IsFeatureEnabled('CatCompleteSet');
if (!$boolFeatureSet) {
return true;
}
self::$arSrcValues[self::$strMainPrefix] = array();
self::$arCheckValues[self::$strMainPrefix] = array();
if (isset($_POST[self::$strMainPrefix]) && is_array($_POST[self::$strMainPrefix])) {
CCatalogProductSet::disableShowErrors();
self::$arSrcValues[self::$strMainPrefix] = $_POST[self::$strMainPrefix];
foreach (self::$arSrcValues[self::$strMainPrefix] as $key => $arOneSet) {
$boolNew = 0 >= (int) $key;
$arSaveSet = array('TYPE' => self::$intTypeID, 'ITEM_ID' => $arItem['PRODUCT_ID'], 'ACTIVE' => 'Y', 'ITEMS' => array());
if (CCatalogProductSet::TYPE_SET == self::$intTypeID) {
foreach ($arOneSet['ITEMS'] as $keyItem => $arOneItem) {
if ('Y' == $arOneItem['DEL']) {
continue;
}
$arOneItem['DISCOUNT_PERCENT'] = trim($arOneItem['DISCOUNT_PERCENT']);
$arSaveItem = array('ITEM_ID' => $arOneItem['ITEM_ID'], 'QUANTITY' => $arOneItem['QUANTITY'], 'DISCOUNT_PERCENT' => '' == $arOneItem['DISCOUNT_PERCENT'] ? false : $arOneItem['DISCOUNT_PERCENT'], 'SORT' => $arOneItem['SORT']);
$arSaveSet['ITEMS'][] = $arSaveItem;
}
} else {
foreach ($arOneSet['ITEMS'] as $keyItem => $arOneItem) {
if ('Y' == $arOneItem['DEL']) {
continue;
}
$arSaveItem = array('ITEM_ID' => $arOneItem['ITEM_ID'], 'QUANTITY' => $arOneItem['QUANTITY'], 'SORT' => $arOneItem['SORT']);
if ($arSaveItem['QUANTITY'] == '') {
$arSaveItem['QUANTITY'] = 1;
}
$arSaveSet['ITEMS'][] = $arSaveItem;
}
}
$arTestSet = $arSaveSet;
$boolCheck = $boolNew ? CCatalogProductSet::checkFields('TEST', $arTestSet, 0) : CCatalogProductSet::checkFields('UPDATE', $arTestSet, $key);
if (!$boolCheck) {
$ex = new CAdminException(CCatalogProductSet::getErrors());
self::$arErrors[$key] = $ex->GetString();
} else {
self::$arCheckValues[self::$strMainPrefix][$key] = $arSaveSet;
}
break;
}
CCatalogProductSet::enableShowErrors();
return empty(self::$arErrors);
}
return true;
}