projects/apttus/ecommerce/src/lib/modules/promotion/services/promotion.service.ts
Promotion Service defines a way to add/remove promotions to/from the cart.
AObjectService
Properties |
Methods |
| applyPromotions | ||||||||
applyPromotions(promocode: string)
|
||||||||
|
Method applies promotion to the current cart based on the promo code passed. Example:
Parameters :
Returns :
Observable<boolean>
a void observable when the operation has completed. |
| getAppliedPromotionForCart | ||||||
getAppliedPromotionForCart(incentiveCode?: string)
|
||||||
|
Method returns an observable containing an array of adjustment line items for the current cart. Example:
Parameters :
Returns :
Observable<Array<AdjustmentItem>>
an observable containing an array of adjustment line items for the current cart. |
| onInit |
onInit()
|
|
Returns :
void
|
| removeAppliedPromotion | ||||||
removeAppliedPromotion(incentive: Incentive)
|
||||||
|
Method removes the promotion from the current cart if it is already applied. Example:
Parameters :
Returns :
Observable<boolean>
a void observable when the operation has completed. |
| invalidPromotion |
Type : EventEmitter<string>
|
Default value : new EventEmitter<string>()
|
| onRemovePromotion |
Type : EventEmitter<string>
|
Default value : new EventEmitter<string>()
|
| promocode |
Type : string
|
| type |
Default value : AdjustmentItem
|