DCShoppingcartNestedOffer

DCShoppingcartNestedOffer

DCShoppingcartNestedOffer is a Lightning web component to show the offer child bundles of the offer that is being added to the cart.

Constructor

new DCShoppingcartNestedOffer()

Properties:
Name Type Description
fromParent Boolean boolean value whether to show header titles for parent offer.
nestedOffer 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.
Example
Sample Usage -

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

<c-dc-shopping-nested-offer nested-offer="{}" category-name="Phones" from-parent=true
parent-index="0"></c-dc-shopping-nested-offer>

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

 events fired : none

 events registered : none

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

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

Sample with slots -

<c-dc-shopping-nested-offer>
   <span slot="{slot_name}">
     Custom HTML elements goes here
   </span>
</c-dc-shopping-nested-offer>

List of available slots -

| Slot names                        | Dynamic     | Description                           | Impact                 |
|-----------------------------------|-------------|---------------------------------------|------------------------|
| dc-nested-cart-wrapper            | -           | Wrapper for component                 | Replaces template DOM  |

Extends

Members

(static) getNestedOfferClass

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

Methods

(static) connectedCallback()

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

(static) isChildOffersExist(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.