本文整理汇总了PHP中CCatalogProductSet::add方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogProductSet::add方法的具体用法?PHP CCatalogProductSet::add怎么用?PHP CCatalogProductSet::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogProductSet
的用法示例。
在下文中一共展示了CCatalogProductSet::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ImportProductSets
function ImportProductSets()
{
if ($this->bCatalog && $this->next_step["SETS"] > 0) {
$rsParents = $this->_xml_file->GetList(array("ID" => "asc"), array("PARENT_ID" => $this->next_step["SETS"]), array("ID", "LEFT_MARGIN", "RIGHT_MARGIN"));
while ($arParent = $rsParents->Fetch()) {
$arXMLElement = $this->_xml_file->GetAllChildrenArray($arParent);
if (isset($arXMLElement[$this->mess["IBLOCK_XML2_ID"]])) {
$rsElement = CIBlockElement::GetList(array(), array("=XML_ID" => $arXMLElement[$this->mess["IBLOCK_XML2_ID"]], "IBLOCK_ID" => $this->next_step["IBLOCK_ID"]), false, false, array("ID", "IBLOCK_ID"));
if ($arDBElement = $rsElement->Fetch()) {
CCatalogProductSet::deleteAllSetsByProduct($arDBElement["ID"], CCatalogProductSet::TYPE_GROUP);
if (isset($arXMLElement[$this->mess["IBLOCK_XML2_PRODUCT_SET"]])) {
$arFields = array("ITEM_ID" => $arDBElement["ID"], "TYPE" => CCatalogProductSet::TYPE_GROUP, "ITEMS" => array());
foreach ($arXMLElement[$this->mess["IBLOCK_XML2_PRODUCT_SET"]] as $xmlSet) {
$arFields["ITEMS"][] = array("ITEM_ID" => $this->GetElementByXML_ID($arDBElement["IBLOCK_ID"], $xmlSet[$this->mess["IBLOCK_XML2_VALUE"]]), "SORT" => intval($xmlSet[$this->mess["IBLOCK_XML2_SORT"]]));
}
CCatalogProductSet::add($arFields);
}
}
}
}
}
}
示例2: saveFormValues
public static function saveFormValues($arItem)
{
$boolFeatureSet = CBXFeatures::IsFeatureEnabled('CatCompleteSet');
if (!$boolFeatureSet) {
return;
}
if (0 >= $arItem['PRODUCT_ID']) {
return;
}
if (!empty(self::$arCheckValues[self::$strMainPrefix])) {
foreach (self::$arCheckValues[self::$strMainPrefix] as $key => $arSaveSet) {
if (0 >= $arSaveSet['ITEM_ID']) {
$arSaveSet['ITEM_ID'] = $arItem['PRODUCT_ID'];
}
$boolNew = 0 >= (int) $key;
if ($boolNew) {
CCatalogProductSet::add($arSaveSet);
} else {
CCatalogProductSet::update($key, $arSaveSet);
}
}
}
}