OrderDiscountBase
Table of Contents
Constants
- ERROR_ID = 'BX_SALE_ORDER_DISCOUNT'
- EVENT_ON_BUILD_DISCOUNT_PROVIDERS = 'onBuildDiscountProviders'
- PROVIDER_ACTION_APPLY_COUPON = 'calculateApplyCoupons'
- PROVIDER_ACTION_GET_URL = 'getEditUrl'
- PROVIDER_ACTION_PREPARE_DISCOUNT = 'prepareData'
- PROVIDER_ACTION_ROUND_BASKET_PRICES = 'roundBasket'
- PROVIDER_ACTION_ROUND_ITEM_PRICE = 'roundPrice'
- STORAGE_TYPE_BASKET_ITEM = 'BASKET_ITEM'
- STORAGE_TYPE_DISCOUNT_ACTION_DATA = 'ACTION_DATA'
- STORAGE_TYPE_ORDER_CONFIG = 'ORDER_CONFIG'
- STORAGE_TYPE_ROUND_CONFIG = 'ROUND_CONFIG'
Methods
- addResultBlock() : mixed
- addRoundBlock() : mixed
- calculateApplyCoupons() : bool|array<string|int, mixed>
- Check apply discount.
- checkDiscountProvider() : bool
- Check existing discount provider for module.
- clearCache() : void
- Clear discount cache.
- deleteByOrder() : void
- Delete all data by order.
- getEditUrl() : string
- Return url for edit sale discount.
- getManagerConfig() : array<string|int, mixed>
- Return current manager params.
- getOrderCouponIterator() : Result|null
- Order coupons getList (prototype).
- init() : void
- Initial discount manager.
- loadResultFromDb() : Result
- Load discount result for order.
- roundBasket() : array<string|int, mixed>
- Round basket prices.
- roundPrice() : array<string|int, mixed>
- Round basket item price.
- saveCoupon() : Result
- Save coupon.
- saveDiscount() : Result
- Convert and save discount.
- saveOrderStoredData() : Result
- Save order stored data.
- saveStoredDataBlock() : Result
- Save stored data for entities.
- setManagerConfig() : bool
- Set manager params.
- updateResultBlock() : mixed
- updateRoundBlock() : mixed
Constants
ERROR_ID
public
mixed
ERROR_ID
= 'BX_SALE_ORDER_DISCOUNT'
EVENT_ON_BUILD_DISCOUNT_PROVIDERS
public
mixed
EVENT_ON_BUILD_DISCOUNT_PROVIDERS
= 'onBuildDiscountProviders'
PROVIDER_ACTION_APPLY_COUPON
public
mixed
PROVIDER_ACTION_APPLY_COUPON
= 'calculateApplyCoupons'
PROVIDER_ACTION_GET_URL
public
mixed
PROVIDER_ACTION_GET_URL
= 'getEditUrl'
PROVIDER_ACTION_PREPARE_DISCOUNT
public
mixed
PROVIDER_ACTION_PREPARE_DISCOUNT
= 'prepareData'
PROVIDER_ACTION_ROUND_BASKET_PRICES
public
mixed
PROVIDER_ACTION_ROUND_BASKET_PRICES
= 'roundBasket'
PROVIDER_ACTION_ROUND_ITEM_PRICE
public
mixed
PROVIDER_ACTION_ROUND_ITEM_PRICE
= 'roundPrice'
STORAGE_TYPE_BASKET_ITEM
public
mixed
STORAGE_TYPE_BASKET_ITEM
= 'BASKET_ITEM'
STORAGE_TYPE_DISCOUNT_ACTION_DATA
public
mixed
STORAGE_TYPE_DISCOUNT_ACTION_DATA
= 'ACTION_DATA'
STORAGE_TYPE_ORDER_CONFIG
public
mixed
STORAGE_TYPE_ORDER_CONFIG
= 'ORDER_CONFIG'
STORAGE_TYPE_ROUND_CONFIG
public
mixed
STORAGE_TYPE_ROUND_CONFIG
= 'ROUND_CONFIG'
Methods
addResultBlock()
public
static addResultBlock(mixed $order, array<string|int, mixed> $block) : mixed
Parameters
- $order : mixed
- $block : array<string|int, mixed>
addRoundBlock()
public
static addRoundBlock(mixed $order, array<string|int, mixed> $block) : mixed
Parameters
- $order : mixed
- $block : array<string|int, mixed>
calculateApplyCoupons()
Check apply discount.
public
static calculateApplyCoupons(string $module, array<string|int, mixed> $discount, array<string|int, mixed> $basket, array<string|int, mixed> $params) : bool|array<string|int, mixed>
Parameters
- $module : string
-
Discount module.
- $discount : array<string|int, mixed>
-
Discount data.
- $basket : array<string|int, mixed>
-
Basket data.
- $params : array<string|int, mixed>
-
Calculate params.
Return values
bool|array<string|int, mixed>checkDiscountProvider()
Check existing discount provider for module.
public
static checkDiscountProvider(string $module) : bool
Parameters
- $module : string
-
Module id.
Return values
boolclearCache()
Clear discount cache.
public
static clearCache() : void
deleteByOrder()
Delete all data by order.
public
static deleteByOrder(int $order) : void
Parameters
- $order : int
-
Order id.
getEditUrl()
Return url for edit sale discount.
public
static getEditUrl(array<string|int, mixed> $discount) : string
Parameters
- $discount : array<string|int, mixed>
-
Discount data.
Return values
stringgetManagerConfig()
Return current manager params.
public
static getManagerConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getOrderCouponIterator()
Order coupons getList (prototype).
public
static getOrderCouponIterator(array<string|int, mixed> $parameters) : Result|null
Parameters
- $parameters : array<string|int, mixed>
-
\Bitrix\Main\Entity\DataManager::getList parameters.
Return values
Result|nullinit()
Initial discount manager.
public
static init() : void
loadResultFromDb()
Load discount result for order.
public
static loadResultFromDb(int $order[, array<string|int, mixed>|bool $basketList = [] ][, array<string|int, mixed> $basketData = [] ]) : Result
Parameters
- $order : int
-
Order id.
- $basketList : array<string|int, mixed>|bool = []
-
Correspondence between basket ids and basket codes.
- $basketData : array<string|int, mixed> = []
-
Basket data.
Return values
ResultroundBasket()
Round basket prices.
public
static roundBasket(array<string|int, mixed> $basket[, array<string|int, mixed> $roundData = array() ][, array<string|int, mixed> $orderData = array() ]) : array<string|int, mixed>
Parameters
- $basket : array<string|int, mixed>
-
Basket.
- $roundData : array<string|int, mixed> = array()
-
Round data.
- $orderData : array<string|int, mixed> = array()
-
Order (without basket).
Return values
array<string|int, mixed>roundPrice()
Round basket item price.
public
static roundPrice(array<string|int, mixed> $basketItem[, array<string|int, mixed> $roundData = array() ]) : array<string|int, mixed>
Parameters
- $basketItem : array<string|int, mixed>
-
Basket item data.
- $roundData : array<string|int, mixed> = array()
-
Round data.
Return values
array<string|int, mixed>saveCoupon()
Save coupon.
public
static saveCoupon(array<string|int, mixed> $coupon) : Result
Parameters
- $coupon : array<string|int, mixed>
-
Coupon data.
Return values
ResultsaveDiscount()
Convert and save discount.
public
static saveDiscount(array<string|int, mixed> $discount[, bool $extResult = false ]) : Result
Parameters
- $discount : array<string|int, mixed>
-
Discount data.
- $extResult : bool = false
-
Result extended result data.
Return values
ResultsaveOrderStoredData()
Save order stored data.
public
static saveOrderStoredData(int $order, string $storageType, array<string|int, mixed> $data[, array<string|int, mixed> $options = array() ]) : Result
Parameters
- $order : int
- $storageType : string
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = array()
Return values
ResultsaveStoredDataBlock()
Save stored data for entities.
public
static saveStoredDataBlock(int $order, string $storageType, array<string|int, mixed> $block[, array<string|int, mixed> $options = array() ]) : Result
Parameters
- $order : int
- $storageType : string
- $block : array<string|int, mixed>
- $options : array<string|int, mixed> = array()
Tags
Return values
ResultsetManagerConfig()
Set manager params.
public
static setManagerConfig(array<string|int, mixed> $config) : bool
Parameters
- $config : array<string|int, mixed>
-
Manager params (site, currency, etc).
Return values
boolupdateResultBlock()
public
static updateResultBlock(mixed $order, array<string|int, mixed> $block) : mixed
Parameters
- $order : mixed
- $block : array<string|int, mixed>
updateRoundBlock()
public
static updateRoundBlock(mixed $order, array<string|int, mixed> $block) : mixed
Parameters
- $order : mixed
- $block : array<string|int, mixed>