本文整理汇总了PHP中CCatalogGroup::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogGroup::getList方法的具体用法?PHP CCatalogGroup::getList怎么用?PHP CCatalogGroup::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogGroup
的用法示例。
在下文中一共展示了CCatalogGroup::getList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowError
<?php
use Bitrix\Main\Loader;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!Loader::includeModule("sale") || !Loader::includeModule("iblock") || !Loader::includeModule("catalog")) {
ShowError(GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_NEED_REQUIRED_MODULES"));
die;
}
// Prices
$catalogGroupIterator = CCatalogGroup::getList(array("NAME" => "ASC", "SORT" => "ASC"));
$catalogGroups = array();
while ($catalogGroup = $catalogGroupIterator->fetch()) {
$catalogGroups[$catalogGroup['NAME']] = "[{$catalogGroup['NAME']}] {$catalogGroup['NAME_LANG']}";
}
// iblockTypes
$iblockTypes = CIBlockParameters::getIBlockTypes();
$iblockNames = array();
$iblockIterator = CIBlock::GetList(array("SORT" => "ASC"), array("TYPE" => $arCurrentValues["IBLOCK_TYPE"] != "-" ? $arCurrentValues["IBLOCK_TYPE"] : ""));
while ($iblock = $iblockIterator->fetch()) {
$iblockNames[$iblock['ID']] = "[{$iblock['CODE']}] {$iblock['NAME']}";
}
$arAscDesc = array("asc" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SORT_ASC"), "desc" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SORT_DESC"));
$arComponentParameters = array("GROUPS" => array("PRICES" => array("NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PRICES")), "BASKET" => array("NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_BASKET"))), "PARAMETERS" => array("IBLOCK_TYPE" => array("PARENT" => "BASE", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_TYPE"), "TYPE" => "LIST", "VALUES" => $iblockTypes, "DEFAULT" => "catalog", "REFRESH" => "Y"), "IBLOCK_ID" => array("PARENT" => "BASE", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_IBLOCK_ID"), "TYPE" => "LIST", "VALUES" => $iblockNames, "DEFAULT" => '={$_REQUEST["IBLOCK_ID"]}', "ADDITIONAL_VALUES" => "Y", "REFRESH" => "Y"), "ID" => array("PARENT" => "BASE", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_ID"), "TYPE" => "STRING", "DEFAULT" => '={$_REQUEST["PRODUCT_ID"]}'), "CODE" => array("PARENT" => "BASE", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_CODE"), "TYPE" => "STRING", "DEFAULT" => '={$_REQUEST["PRODUCT_CODE"]}'), "PROPERTY_LINK" => array("PARENT" => "BASE", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_PROP_LIST"), "TYPE" => "STRING", "DEFAULT" => "RECOMMEND"), "OFFERS_PROPERTY_LINK" => array("PARENT" => "BASE", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_OFFERS_PROP_LIST"), "TYPE" => "STRING", "DEFAULT" => "RECOMMEND"), "CACHE_TIME" => array("DEFAULT" => 86400), "DETAIL_URL" => CIBlockParameters::GetPathTemplateParam("DETAIL", "DETAIL_URL", GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_DETAIL_URL"), "", "URL_TEMPLATES"), "BASKET_URL" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_BASKET_URL"), "TYPE" => "STRING", "DEFAULT" => "/personal/basket.php"), "ACTION_VARIABLE" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_ACTION_VARIABLE"), "TYPE" => "STRING", "DEFAULT" => "action"), "PRODUCT_ID_VARIABLE" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PRODUCT_ID_VARIABLE"), "TYPE" => "STRING", "DEFAULT" => "id"), "PRODUCT_QUANTITY_VARIABLE" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PRODUCT_QUANTITY_VARIABLE"), "TYPE" => "STRING", "DEFAULT" => "quantity"), "ADD_PROPERTIES_TO_BASKET" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_ADD_PROPERTIES_TO_BASKET"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y", "REFRESH" => "Y"), "PRODUCT_PROPS_VARIABLE" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PRODUCT_PROPS_VARIABLE"), "TYPE" => "STRING", "DEFAULT" => "prop", "HIDDEN" => isset($arCurrentValues['ADD_PROPERTIES_TO_BASKET']) && $arCurrentValues['ADD_PROPERTIES_TO_BASKET'] == 'N' ? 'Y' : 'N'), "PARTIAL_PRODUCT_PROPERTIES" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PARTIAL_PRODUCT_PROPERTIES"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "HIDDEN" => isset($arCurrentValues['ADD_PROPERTIES_TO_BASKET']) && $arCurrentValues['ADD_PROPERTIES_TO_BASKET'] == 'N' ? 'Y' : 'N'), "SHOW_OLD_PRICE" => array("PARENT" => "PRICES", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SHOW_OLD_PRICE"), "TYPE" => "CHECKBOX", "VALUES" => "N"), 'SHOW_DISCOUNT_PERCENT' => array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SHOW_DISCOUNT_PERCENT'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N'), "PRICE_CODE" => array("PARENT" => "PRICES", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PRICE_CODE"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $catalogGroups), "SHOW_PRICE_COUNT" => array("PARENT" => "PRICES", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SHOW_PRICE_COUNT"), "TYPE" => "STRING", "DEFAULT" => "1"), 'PRODUCT_SUBSCRIPTION' => array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PRODUCT_SUBSCRIPTION'), 'TYPE' => 'CHECKBOX', 'DEFAULT' => 'N'), "PRICE_VAT_INCLUDE" => array("PARENT" => "PRICES", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_VAT_INCLUDE"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), "USE_PRODUCT_QUANTITY" => array("PARENT" => "BASKET", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_USE_PRODUCT_QUANTITY"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "REFRESH" => "Y"), "SHOW_NAME" => array("PARENT" => "VISUAL", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SHOW_NAME"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), "SHOW_IMAGE" => array("PARENT" => "VISUAL", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_SHOW_IMAGE"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), 'MESS_BTN_BUY' => array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_BTN_BUY'), 'TYPE' => 'STRING', 'DEFAULT' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_BTN_BUY_DEFAULT')), 'MESS_BTN_DETAIL' => array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_BTN_DETAIL'), 'TYPE' => 'STRING', 'DEFAULT' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_BTN_DETAIL_DEFAULT')), 'MESS_NOT_AVAILABLE' => array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_NOT_AVAILABLE'), 'TYPE' => 'STRING', 'DEFAULT' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_NOT_AVAILABLE_DEFAULT')), 'MESS_BTN_SUBSCRIBE' => array('PARENT' => 'VISUAL', 'NAME' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_BTN_SUBSCRIBE'), 'TYPE' => 'STRING', 'DEFAULT' => GetMessage('CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_MESS_BTN_SUBSCRIBE_DEFAULT')), "PAGE_ELEMENT_COUNT" => array("PARENT" => "VISUAL", "NAME" => GetMessage("CATALOG_RECOMMENDED_PRODUCTS_COMPONENT_PAGE_ELEMENT_COUNT"), "TYPE" => "STRING", "DEFAULT" => "30")));
// Params groups
$iblockMap = array();
$iblockIterator = CIBlock::GetList(array("SORT" => "ASC"), array("ACTIVE" => "Y"));
while ($iblock = $iblockIterator->fetch()) {
$iblockMap[$iblock['ID']] = $iblock;
}