Bitrix Site Manager

CCatalogGroup::GetList

CDBResult
CCatalogGroup::GetList(
 string &by, 
 string &order, 
 array arFilter = Array(), 
 string lang = LANGUAGE_ID
);

The method GetList returns a set of price types satisfying the specified filter arFilter. The returned records are sorted by the parameter by in the order order.

Parameters

ParameterDescription
by Field by which the list entries are to be sorted. Can be one of the following:
  • SORT - by the field "Sort weight" (default option);
  • BASE - by the flag denoting the base price type; 
  • NAME - by the field "Name" (internal name);
  • ID - by the field "ID".
order Sort order. Can be one of the following:
  • ASC - ascending (default);
  • DESC - descending.
arFilter Array with fields by which the returned records are to be filtered. Keys are the field names; values are conditions. The array can have the following keys:
  • BASE - flag "base price type";
  • NAME - internal name of the price type.
lang Language ID. By default, current language is used.

Return Values

An instance of the class CDBResult containing a set of the associated arrays with the following keys.

Key Description
ID Price type ID.
NAME Internal name of the price type.
BASE Indicates that the returned type is the base price type ("Y"). Otherwise, value of this key is "N".
SORT Sort weight.
CAN_ACCESS If "Y", the current user is allowed to view prices of this type. If "N", prices of this type should be hidden.
CAN_BUY If "Y", the current user is allowed to purchase at prices of this type. Otherwise "N".
NAME_LANG Name of the price type in the language lang.

Example



<?
// Select all price types with the internal name "retail"
$dbPriceType = CCatalogGroup::GetList(($v1="SORT"),
                                      ($v2="ASC"),
                                      array("NAME" => "retail"));

while ($arPriceType = $dbPriceType->Fetch())
{
    echo $arPriceType["NAME_LANG"]." - ".$arPriceType["CAN_ACCESS"]."<br>";
}
?>