Discount
\Bitrix\Sale\Discount namespace contains subspaces, classes and methods for calculating all discounts (catalog and online store) for shopping cart and order.
Namespace | Description |
---|---|
Formatter | Intended for generating descriptions for both shopping cart rules and results. |
Gift | Contains classes for handling gifts. |
Methods
Method | Description | Available from version | until version |
---|---|---|---|
buildFromBasket | Sets user context for calculating discounts. | ||
calculate | Fully calculates all discounts. | ||
clearBasketItemData | Deletes internal data cache for shopping cart item. Called when deleting a shopping cart item. | ||
getApplyMode | Returns rules for shopping cart rules interaction with discounts of other modules for an order. | ||
getApplyModeList | Returns list of modes for interaction of shopping cart rules and discounts of other modules. | ||
getApplyResult | Returns 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). | ||
getOrder | Returns order object. | ||
getShipmentsIds | Returns list of shipment IDs for existing order. | ||
getUseMode | Returns current calculation mode for all discounts and order/shopping cart rules. | ||
isClone | Returns true, when query clones a discounts object. | ||
isOrderExists | Returns flag enabling an order existence (true/false), because calculation can be performed for shopping cart without an order. | ||
isOrderNew | Returns flag specifying that order is new, i. e. order doesn't have an ID yet. | ||
isOrderRefresh | Returns flag for full order recalculation. | ||
load | Returns initialized discount object for passed order object. | ||
loadByBasket | Returns initialized discount object for passed shopping cart object, not associated with order. | ||
loadByFuser | Returns initialized discount object for combination of $fuser and $site. | ||
save | Saves results for discounts and rounding off rules applied to an order. | ||
setApplyResult | Allows to specify, which of selected discounts and rules to be excluded from calculation. | ||
setCalculateShipments | Sets shipment for calculations. | ||
setOrder | Method is needed to calculate discounts for shopping cart object. After calculation, this shopping cart is associated to an order. | ||
setOrderRefresh | Sets order calculation flag in the administrative edit form. | ||
setUseMode | Sets mode for calculation of all discounts and rules for an order/shopping cart. |
© «Bitrix24», 2001-2024