Documentation

GetOffersArray

Description and parameters

array CIBlockPriceTools::GetOffersArray(
  mixed arFilter, 
  array arElementID, 
  array arOrder, 
  array arSelectFields, 
  array arSelectProperties, 
  int limit, 
  array arPrices, 
  bool vat_include, 
  array arCurrencyParams = array(),
  int USER_ID = 0,
  string LID = SITE_ID
)

Method returns array of commercial quotes for single or several product of one informatino blocks. Static method.

Call parameters

Parameter DescriptionAvailable from version
arFilter Integer - iblock ID or associative array with keys:
  • IBLOCK_ID - information block ID;
  • HIDE_NOT_AVAILABLE - flag "Hide quotes, unavailable in warehouse" (Y/N);
  • CHECK_PERMISSIONS - flag for checking access permissions to information block (Y/N).
Prior to version 12.5.4 only iblock could be specified.
arElementID Array of iblock elements. Empty array() returns all commercial quotes.
arOrder Associatiму array for sorting resulting set of commercial quotes. This set is used sequentially by each key-array value pair. Array keys are commercial quotes parameter names used for sorting. Values define sorting directions.

Available keys and values are similar to keys and values of array arOrder of method CIBlockElement::GetList.
arSelectFields Array of commercial quote fields to be returned by the method. Available keys - all element fields for inforamtion block of commercial quotes.

Empty array array() returns fields as follows:
  • ID - commercial quote ID;
  • IBLOCK_ID - commercial quote information block ID;
  • PROPERTY_property_code - commercial quote proeprty ID (effectively - product identifier);
  • CATALOG_XXX (where XXX - is QUANTITY, QUANTITY_TRACE, QUANTITY_TRACE_ORIG, CAN_BUY_ZERO and etc) - all fields of class CCatalogProduct for commercial quote.
arSelectProperties Array of character or numerical codes for commercial quote properties to be returned by the method. When array is not empty, the key PROPERTIES returns values of all commercial quote property values, and the key DISPLAY_PROPERTIES - non-empty property values, formatted for showing in public components and enumerated in this array.
limit Maximum number of quotes for a single product. When set as 0, returns all commercial quotes for specified products.
arPrices Array of price types, returned by the method CIBlockPriceTools::GetCatalogPrices. Calculates discounts, minimum price and etc.
vat_include Attribute to include VAT into price when showing, if it wasn't included yet.
arCurrencyParams Array of prices for showing prices in a single currency. When the passed array has a filled our field CURRENCY_ID, the method converts currency to CURRENCY_ID based on currency rate. Optional parameter.
USER_ID User ID. The value is non-empty when calculations are performed not for the current user. Optional parameter.
LID Site ID. The value is non-empty when calculations are performed not for the current site. Optional parameter.

Returned value

Associative array of commercial quotes, including all fields, requested in method массив торговых предложений, включающий в себя все запрошенные в методе поля, поля класса CCatalogProduct, а также следующие ключи:

  • PRICES - prices returned by CIBlockPriceTools::GetItemPrice;
  • MIN_PRICE - array describing minimal price;
  • CAN_BUY - availability for purchase (true/false);
  • LINK_ELEMENT_ID - product ID for quote;
  • PROPERTIES - non-formatted values of all iblock element properties, specifically empty properties (array is not empty, when at least single property is requested in $arSelectProperties);
  • DISPLAY_PROPERTIES - only non-empty properties (from the list $arSelectProperties);
  • CATALOG_MEASURE_NAME - measurement unit name (abbreviated);
  • CATALOG_MEASURE - measurement unit code;
  • CATALOG_RATIO - measurement unit ratio.

© «Bitrix24», 2001-2024
Up