VlocityDCShoppingNestedOffer

VlocityDCShoppingNestedOffer

vlocity-dc-shopping-nested-offer is a web component to show the offer bundles of the offer that is being added to the cart.

Constructor

new VlocityDCShoppingNestedOffer()

Properties:
Name Type Description
fromParent Boolean boolean value whether to show header titles for parent offer.
nestedProduct Offer holds the nested offer bundle.
categoryName String category of offer bundle eg: Add-ons, Accessories etc. .
parentIndex Number index=0 if it is parent offer, otherwise it is child offer/bundle.
isQuantityEditable Boolean to determine whether Quantity field is read-only or not.
Example
Sample Usage -

Include the component in your template simply by adding <vlocity-dc-shopping-nested-offer> custom tag

<vlocity-dc-shopping-nested-offer .nestedProduct="{}" .categoryName="Phones" .fromParent="true"
.parentIndex="0" .isQuantityEditable="true"></vlocity-dc-shopping-nested-offer>

--------------------------------------------------------------------------------------------------------------------------------------
 KEY INFO -

 events fired : none

 events registered : none

 Dependency - vlocity-dc-shopping-nested-offer is a component that is commonly used as a child of vlocity-dc-shopping-cart but it
 can also be used as an independent component.

       | Parent Component         | Expected Child Component            |
       |--------------------------|-------------------------------------|
       | vlocity-dc-shopping-cart | vlocity-dc-shopping-offer-details   |

Extends

  • LitElement

Members

(static, readonly) properties

Properties that will be available in the binding system
Properties:
Name Type Description
fromParent Boolean value to decide to show header titles in UI.
nestedProduct Object holds the nested offer bundle.
categoryName String category of offer bundle eg: Add-ons, Accessories etc. .
parentIndex Number index=0 if it is parent offer, otherwise it is child offer/bundle.
lineItemsAvailable Boolean set to true if child offers are alredy added to cart.
isQuantityEditable Boolean set to false if Quantity field is read-only.
productGroupsAvailable Boolean set to true if nested offer bundles are available.

Methods

(static) connectedCallback()

Invoked when vlocity-dc-shopping-nested-offer component is added to the document’s DOM.

(static) getNestedProductClass()

Method to generate dynamic class based on isChildProductsExist() and fromParent boolean variable

(static) isChildProductsExist(currentPlanGroup, isFromParent)

Method to check whether child offers are present in given currentPlanGroup
Parameters:
Name Type Description
currentPlanGroup Object offer bundle.
isFromParent Boolean boolean value whether to show header titles for parent offer.