Documentation

Discount

\Bitrix\Sale\Discount namespace contains subspaces, classes and methods for calculating all discounts (catalog and online store) for shopping cart and order.

NamespaceDescription
FormatterIntended for generating descriptions for both shopping cart rules and results.
GiftContains classes for handling gifts.

Methods

MethodDescription Available from versionuntil version
buildFromBasketSets user context for calculating discounts.
calculateFully calculates all discounts.
clearBasketItemDataDeletes internal data cache for shopping cart item. Called when deleting a shopping cart item.
getApplyModeReturns rules for shopping cart rules interaction with discounts of other modules for an order.
getApplyModeListReturns list of modes for interaction of shopping cart rules and discounts of other modules.
getApplyResultReturns all calculation results, including total and basic (initial) prices for shopping cart, delivery, list of applied discounts, shopping cart rules and coupons, enabling/disabling flags (on/off).
getOrderReturns order object.
getShipmentsIdsReturns list of shipment IDs for existing order.
getUseModeReturns current calculation mode for all discounts and order/shopping cart rules.
isCloneReturns true, when query clones a discounts object.
isOrderExistsReturns flag enabling an order existence (true/false), because calculation can be performed for shopping cart without an order.
isOrderNewReturns flag specifying that order is new, i. e. order doesn't have an ID yet.
isOrderRefreshReturns flag for full order recalculation.
loadReturns initialized discount object for passed order object.
loadByBasketReturns initialized discount object for passed shopping cart object, not associated with order.
loadByFuserReturns initialized discount object for combination of $fuser and $site.
saveSaves results for discounts and rounding off rules applied to an order.
setApplyResultAllows to specify, which of selected discounts and rules to be excluded from calculation.
setCalculateShipmentsSets shipment for calculations.
setOrderMethod is needed to calculate discounts for shopping cart object. After calculation, this shopping cart is associated to an order.
setOrderRefreshSets order calculation flag in the administrative edit form.
setUseModeSets mode for calculation of all discounts and rules for an order/shopping cart.


© «Bitrix24», 2001-2024
Up