本文整理汇总了PHP中CCatalogProductSet::isProductHaveSet方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogProductSet::isProductHaveSet方法的具体用法?PHP CCatalogProductSet::isProductHaveSet怎么用?PHP CCatalogProductSet::isProductHaveSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogProductSet
的用法示例。
在下文中一共展示了CCatalogProductSet::isProductHaveSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (!is_array($arParams["OFFERS_CART_PROPERTIES"]))
$arParams["OFFERS_CART_PROPERTIES"] = array();
foreach($arParams["OFFERS_CART_PROPERTIES"] as $i => $pid)
if ($pid === "")
unset($arParams["OFFERS_CART_PROPERTIES"][$i]);
if($this->StartResultCache(false, array($elementID, ($arParams["CACHE_GROUPS"]==="N"? false: $USER->GetGroups()))))
{
if(!CModule::IncludeModule("catalog"))
{
ShowError(GetMessage("CATALOG_MODULE_NOT_INSTALLED"));
$this->AbortResultCache();
return;
}
$isProductHaveSet = CCatalogProductSet::isProductHaveSet($elementID, CCatalogProductSet::TYPE_GROUP);
$product = false;
if (!$isProductHaveSet)
{
$product = CCatalogSKU::GetProductInfo($elementID, $arParams['IBLOCK_ID']);
if (!empty($product))
{
$isProductHaveSet = true;
}
}
if (!$isProductHaveSet)
{
$this->AbortResultCache();
return;
}
示例2: ExportProductSets
function ExportProductSets()
{
if ($this->bCatalog && $this->bExtended) {
unset($this->next_step["FILTER"][">ID"]);
$rsElements = CIBlockElement::GetList(array(), $this->next_step["FILTER"], false, false, array("ID", "XML_ID"));
fwrite($this->fp, "\t<" . GetMessage("IBLOCK_XML2_PRODUCTS_SETS") . ">\n");
while ($arElement = $rsElements->Fetch()) {
if (CCatalogProductSet::isProductHaveSet($arElement["ID"], CCatalogProductSet::TYPE_GROUP)) {
if (strlen($arElement["XML_ID"]) > 0) {
$xml_id = $arElement["XML_ID"];
} else {
$xml_id = $arElement["ID"];
}
$this->ExportProductSet($arElement["ID"], $xml_id);
}
}
fwrite($this->fp, "\t</" . GetMessage("IBLOCK_XML2_PRODUCTS_SETS") . ">\n");
}
}
示例3: checkFieldsToUpdate
//.........这里部分代码省略.........
unset($arOneItem['ID']);
}
if (!array_key_exists('ITEM_ID', $arOneItem)) {
continue;
}
$arOneItem['ITEM_ID'] = (int) $arOneItem['ITEM_ID'];
if ($arOneItem['ITEM_ID'] <= 0) {
continue;
}
if (isset($arProductInSet[$arOneItem['ITEM_ID']])) {
self::$arErrors[] = array('id' => 'ITEM_ID', 'text' => GetMessage('BT_CAT_PRODUCT_SET_ERR_ITEM_ID_DUBLICATE'));
continue;
}
$arProductInSet[$arOneItem['ITEM_ID']] = true;
$intRowID = self::searchItem($arOneItem['ITEM_ID'], $arCurrent['ITEMS']);
if (false === $intRowID) {
$arOneItem = array_merge($arDefItem, $arOneItem);
} else {
$arOneItem['ID'] = $intRowID;
}
if (array_key_exists('SORT', $arOneItem)) {
$arOneItem['SORT'] = (int) $arOneItem['SORT'];
if ($arOneItem['SORT'] <= 0) {
$arOneItem['SORT'] = 100;
}
}
if (array_key_exists('QUANTITY', $arOneItem)) {
$arOneItem['QUANTITY'] = doubleval($arOneItem['QUANTITY']);
if (0 >= $arOneItem['QUANTITY']) {
self::$arErrors[] = array('id' => 'QUANTITY', 'text' => self::TYPE_SET == $arFields['TYPE'] ? GetMessage('BT_CAT_PRODUCT_SET_ERR_QUANTITY_IS_BAD') : GetMessage('BT_CAT_PRODUCT_SET_ERR_QUANTITY_GROUP_IS_BAD'));
continue;
}
}
if (self::TYPE_SET == $arCurrent['TYPE']) {
if (array_key_exists('MEASURE', $arOneItem)) {
$arOneItem['MEASURE'] = (int) $arOneItem['MEASURE'];
if ($arOneItem['MEASURE'] < 0) {
$arOneItem['MEASURE'] = 0;
}
}
if (array_key_exists('DISCOUNT_PERCENT', $arOneItem)) {
if (false !== $arOneItem['DISCOUNT_PERCENT']) {
$arOneItem['DISCOUNT_PERCENT'] = doubleval($arOneItem['DISCOUNT_PERCENT']);
if (0 > $arOneItem['DISCOUNT_PERCENT'] || 100 < $arOneItem['DISCOUNT_PERCENT']) {
self::$arErrors[] = array('id' => 'DISCOUNT_PERCENT', 'text' => GetMessage('BT_CAT_PRODUCT_SET_ERR_DISCOUNT_PERCENT_IS_BAD'));
continue;
}
$dblDiscountPercent += $arOneItem['DISCOUNT_PERCENT'];
}
} else {
if (false !== $intRowID) {
if (false !== $arCurrent['ITEMS'][$intRowID]['DISCOUNT_PERCENT']) {
$dblDiscountPercent += $arCurrent['ITEMS'][$intRowID]['DISCOUNT_PERCENT'];
}
}
}
}
$arValidItems[] = $arOneItem;
}
unset($arOneItem);
if (empty($arValidItems)) {
self::$arErrors[] = array('id' => 'ITEMS', 'text' => GetMessage('BT_CAT_SET_ERR_EMPTY_VALID_ITEMS'));
} else {
$arFields['ITEMS'] = $arValidItems;
$boolItems = true;
}
unset($arValidItems);
if (100 < $dblDiscountPercent) {
self::$arErrors[] = array('id' => 'DISCOUNT_PERCENT', 'text' => GetMessage('BT_CAT_PRODUCT_SET_ERR_ALL_DISCOUNT_PERCENT_IS_BAD'));
}
}
}
if (empty(self::$arErrors)) {
$arProductList = array_keys($arProductInSet);
if (!self::$disableCheckProduct) {
if (!CCatalogProduct::CheckProducts($arProductList)) {
self::$arErrors[] = array('id' => 'ITEMS', 'text' => GetMessage('BT_CAT_PRODUCT_SET_ERR_ITEMS_IS_NOT_PRODUCT'));
}
}
if (empty(self::$arErrors) && self::TYPE_SET == $arFields['TYPE']) {
if (CCatalogProductSet::isProductHaveSet($arProductList, self::TYPE_SET)) {
self::$arErrors[] = array('id' => 'ITEMS', 'text' => GetMessage('BT_CAT_PRODUCT_SET_ERR_ITEMS_IS_SET'));
}
foreach ($arProductList as &$intOneID) {
if (CCatalogSKU::IsExistOffers($intOneID)) {
self::$arErrors[] = array('id' => 'ITEMS', 'text' => GetMessage('BT_CAT_PRODUCT_SET_ERR_ITEMS_IS_SKU'));
break;
}
}
unset($intOneID);
}
}
}
if (empty(self::$arErrors)) {
if ($boolItems) {
self::setItemFieldsForUpdate($arFields, $arCurrent);
}
}
return empty(self::$arErrors);
}
示例4: unset
if ($pid === "") {
unset($arParams["OFFERS_CART_PROPERTIES"][$i]);
}
}
if ($this->StartResultCache(false, array($elementID, $arParams["CACHE_GROUPS"] === "N" ? false : $USER->GetGroups()))) {
if (!Loader::includeModule('catalog')) {
ShowError(GetMessage("CATALOG_MODULE_NOT_INSTALLED"));
$this->AbortResultCache();
return;
}
$isProductHaveSet = CCatalogProductSet::isProductHaveSet($elementID, CCatalogProductSet::TYPE_GROUP);
$product = false;
if (!$isProductHaveSet) {
$product = CCatalogSKU::GetProductInfo($elementID, $arParams['IBLOCK_ID']);
if (!empty($product)) {
$isProductHaveSet = CCatalogProductSet::isProductHaveSet($product['ID'], CCatalogProductSet::TYPE_GROUP);
if (!$isProductHaveSet) {
$product = false;
}
}
}
if (!$isProductHaveSet) {
$this->AbortResultCache();
return;
}
if (!empty($product)) {
$arResult['PRODUCT_ID'] = $product['ID'];
$arResult['PRODUCT_IBLOCK_ID'] = $product['IBLOCK_ID'];
$arResult['ELEMENT_ID'] = $elementID;
$arResult['ELEMENT_IBLOCK_ID'] = $arParams['IBLOCK_ID'];
} else {
示例5: getShowTabs
public static function getShowTabs($intIBlockID, $intID, &$arCatalog)
{
$intIBlockID = (int) $intIBlockID;
if ($intIBlockID <= 0) {
return false;
}
if (empty($arCatalog)) {
$arCatalog = CCatalogSKU::GetInfoByIBlock($intIBlockID);
}
if (empty($arCatalog)) {
return false;
}
$boolFeatureSet = CBXFeatures::IsFeatureEnabled('CatCompleteSet');
$arResult = array_fill_keys(self::getTabList(false), false);
$strProductType = '';
if (isset($_REQUEST[self::$strMainPrefix . 'PRODUCT_TYPE'])) {
$strProductType = (string) $_REQUEST[self::$strMainPrefix . 'PRODUCT_TYPE'];
if ('' != $strProductType && !isset($arResult[$strProductType])) {
$strProductType = '';
}
}
if ('' != $strProductType && !$boolFeatureSet) {
if (self::TAB_SET == $strProductType || self::TAB_GROUP == $strProductType) {
$strProductType = '';
}
}
if (0 < $intID) {
$intProductID = CIBlockElement::GetRealElement($intID);
$arResult[self::TAB_CATALOG] = CCatalogSKU::TYPE_CATALOG == $arCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_FULL == $arCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_OFFERS == $arCatalog['CATALOG_TYPE'];
$arResult[self::TAB_SKU] = CCatalogSKU::TYPE_PRODUCT == $arCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_FULL == $arCatalog['CATALOG_TYPE'];
if (CCatalogSKU::TYPE_FULL == $arCatalog['CATALOG_TYPE']) {
if (CCatalogSKU::IsExistOffers($intID, $intIBlockID) || CCatalogSKU::TYPE_FULL == $arCatalog['CATALOG_TYPE'] && self::TAB_SKU == $strProductType) {
if ('Y' != COption::GetOptionString('catalog', 'show_catalog_tab_with_offers')) {
$arResult[self::TAB_CATALOG] = false;
}
} else {
$arResult[self::TAB_SKU] = false;
}
}
if (CCatalogSKU::TYPE_PRODUCT != $arCatalog['CATALOG_TYPE']) {
if ($boolFeatureSet) {
if (CCatalogSKU::TYPE_OFFERS != $arCatalog['CATALOG_TYPE']) {
$arResult[self::TAB_SET] = CCatalogProductSet::isProductHaveSet($intProductID, CCatalogProductSet::TYPE_SET) || self::TAB_SET == $strProductType;
}
$arResult[self::TAB_GROUP] = CCatalogProductSet::isProductHaveSet($intProductID, CCatalogProductSet::TYPE_GROUP) || self::TAB_GROUP == $strProductType;
if ($arResult[self::TAB_SET]) {
$arResult[self::TAB_CATALOG] = true;
$arResult[self::TAB_SKU] = false;
}
}
}
} else {
if ('' != $strProductType) {
if (CCatalogSKU::TYPE_OFFERS == $arCatalog['CATALOG_TYPE']) {
if (self::TAB_SET == $strProductType || self::TAB_SKU == $strProductType) {
$strProductType = '';
}
}
}
if ('' != $strProductType) {
$arResult[$strProductType] = true;
if (self::TAB_GROUP == $strProductType || self::TAB_SET == $strProductType) {
$arResult[self::TAB_CATALOG] = true;
}
if (self::TAB_SKU == $strProductType && 'Y' == $arCatalog['CATALOG'] && 'Y' == COption::GetOptionString('catalog', 'show_catalog_tab_with_offers')) {
$arResult[self::TAB_CATALOG] = true;
}
} else {
$arResult[self::TAB_CATALOG] = CCatalogSKU::TYPE_CATALOG == $arCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_FULL == $arCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_OFFERS == $arCatalog['CATALOG_TYPE'];
$arResult[self::TAB_SKU] = CCatalogSKU::TYPE_PRODUCT == $arCatalog['CATALOG_TYPE'] || CCatalogSKU::TYPE_FULL == $arCatalog['CATALOG_TYPE'];
}
}
return $arResult;
}