projects/congarevenuecloud/elements/src/lib/constraint-rule/services/constraint-rule-message.service.ts
Service is responsible to build and format the constraint rule messages to render on the view.
Properties |
Methods |
constructor(constraintRuleService: ConstraintRuleService, productService: ProductService, exceptionService: ExceptionService, primaryCartService: CartService, secondaryCartService: SecondaryCartService, araiService: AppliedRuleActionInfoService, productOptionService: ProductOptionService, storefrontService: StorefrontService)
|
|||||||||||||||||||||||||||
|
Parameters :
|
| addMultipleProductsToCart | ||||||||||||||||||||
addMultipleProductsToCart(ruleDetail: ConstraintRuleDetail | AppliedRuleActionInfo, products: Array<Product>, quantity: number)
|
||||||||||||||||||||
|
Adds products to the cart based on the provided rule detail. See ConstraintRuleDetail for more details on the structure and fields required.
Parameters :
Returns :
Observable<void>
|
| addProductToCartFromRule | ||||||||||||||||||||
addProductToCartFromRule(ruleDetail: ConstraintRuleDetail | AppliedRuleActionInfo, product: Product, quantity: number)
|
||||||||||||||||||||
|
Adds a product to the cart based on the associated constraint rule. See ConstraintRuleDetail for more details on the structure and fields required.
Parameters :
Returns :
Observable<void>
|
| deleteProductFromCart | ||||||||||||
deleteProductFromCart(ruleDetail: ConstraintRuleDetail | AppliedRuleActionInfo, product: Product)
|
||||||||||||
|
Removes a product from the cart based on the given constraint rule detail object.
Parameters :
Returns :
Observable<string>
|
| deleteReplacementProductsFromCart | ||||||||||||
deleteReplacementProductsFromCart(ruleDetail: ConstraintRuleDetail | AppliedRuleActionInfo, products: Product[])
|
||||||||||||
|
Removes a condition product from the cart based on the given replacement rule detail.
Parameters :
Returns :
Observable<string>
|
| getCartRuleGroups |
getCartRuleGroups()
|
|
Returns an observable of the cart level rule groups. See ConstraintRuleGroups for more details on the structure and fields required.
Returns :
Observable<ConstraintRuleGroups>
An Observable of ConstraintRuleGroups. |
| refreshCartRules |
refreshCartRules()
|
|
Refreshes the cart level constraint rules behavior subject.
Returns :
Observable<ConstraintRuleGroups>
|
| refreshConfigRules |
refreshConfigRules()
|
|
Refreshes the product configuration level constraint rules behavior subject.
Returns :
any
|
| replaceProducts | ||||||||||||
replaceProducts(replacementRules: Array<ConstraintRuleDetail>, actionItems?: Array<ActionItem>)
|
||||||||||||
|
Replaces products in the cart based on the provided replacement rules.
Defaults to the first product from the ConstraintRuleDetail for more details on the structure and fields required. ActionItem for more details on the structure and fields required.
Parameters :
Returns :
Observable<void>
|
| cartRuleGroups$ |
Type : BehaviorSubject<ConstraintRuleGroups>
|
Default value : new BehaviorSubject<ConstraintRuleGroups>(null)
|
|
Groups of cart level constraint rules. |
| showRules$ |
Type : BehaviorSubject<boolean>
|
Default value : new BehaviorSubject<boolean>(true)
|