PromotionSubscriber
in package
Table of Contents
- getAvailablePromotion() : Promotion|null
- This function will retrieve the promotion given the promo code, the user and an optional billable entity.
- subscribeToPromotion() : PromotionsCustomer|false
- This function will subscribe the user to the promotion, if the promotion is available for the user.
Methods
getAvailablePromotion()
This function will retrieve the promotion given the promo code, the user and an optional billable entity.
public
static getAvailablePromotion(string $promoCode, AuthUser $user[, PriceList|null $priceList = null ]) : Promotion|null
It will return false if the promotion is not available for the user.
Parameters
Return values
Promotion|null —subscribeToPromotion()
This function will subscribe the user to the promotion, if the promotion is available for the user.
public
static subscribeToPromotion(Promotion $promotion, AuthUser $user[, IsBillableAbstractClass|null $billable = null ]) : PromotionsCustomer|false
Parameters
- $promotion : Promotion
- $user : AuthUser
- $billable : IsBillableAbstractClass|null = null