Documentation

CCatalogDiscount

Class methods

Method Description Available from versionto version
[link=90200]Add[/link] Adds new discount according to data from array arFields.
[link=90202]Delete[/link] Метод удаляет скидку с кодом ID.
[link=90212]SetCoupon[/link] Adds coupon code into array with discount coupons available for current user. System calculates product price minimal for this user with account of all its discounts and coupons.4.0.412.0.0
[link=90204]GetCoupons[/link] Returns array of available discount coupon for current user. System calculates product price minimal for this user with all discounts and coupons. 4.0.412.0.0
[link=90201]ClearCoupon[/link] Clears array with discount coupons available for getting to current user. System calculates product price minimal for this user with all discounts and coupons.4.0.412.0.0
[link=90205]GetDiscountByPrice[/link] Calculates discount for a price with productPriceID for user in arUserGroups. 4.0.4
[link=90206]GetDiscountByProduct[/link] Calculates product discount with productID for user in arUserGroups.
[link=90203]GetByID[/link] Selects discount parameters by its ID.4.0.4
[link=90211]GetList[/link] Returns retrieved discount records according to parameters.
[link=90208]GetDiscountGroupsList[/link] Returns retrieved of records with details on discounts associated to user groups according to parameters. 4.0.4
[link=90207]GetDiscountCatsList[/link] Returns retrieved records with details on associated discounts to price types according to parameters.4.0.4
[link=90209]GetDiscountProductsList[/link] Returns retrieved records with details on associated discounts to products according to parameters.4.0.412.0.0
[link=90210]GetDiscountSectionsList[/link] Returns retrieved records with details on associated discounts to product groups according to parameters.4.0.412.0.0
[link=90213]Update[/link] Updates discount parameters with OD according to data from array arFields. 4.0.4

Note:

Starting from version 12.0.0 due to updated module logic, the following methods have been deprecated:

  • GetDiscountIBlockList
  • [link=90210]GetDiscountSectionsList[/link]
  • [link=90209]GetDiscountProductsList[/link]

Prior to release of version 12.0.0 all the abovelisted methods were service methods that allowed getting directly defined discount associations to individual iblocks, sections, elements, i. e. data that could be visible in the discount edit form.

It's incorrect to use these methods for getting element IDs that can be affected by discounts. For example, calling [link=90209]GetDiscountProductsList[/link] returns an empty array for a discount, applicable to section only.

With the release of version 12.0 these methods remain for preserving compatibility only. They can return associations only to iblocks, sections, elements, directly specified in limitations. It means that if a discount applies to element name, all the listed methods return empty arrays.



© «Bitrix24», 2001-2024