DCShoppingCartOfferDetails

DCShoppingCartOfferDetails

DCShoppingCartOfferDetails is a Lightning web component to print the offers that are being added to cart.

Constructor

new DCShoppingCartOfferDetails()

Properties:
Name Type Description
offer Offer offer object that need to show in UI.
categoryName String category of offer bundle eg: Add-ons, Accessories etc.
offerOnly Boolean boolean value whether to print header titles as well or just simple offer details.
Example
Sample Usage -

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

<c-dc-shopping-offer-details offer="{}" category-name="Phones" offer-only="true">
</c-dc-shopping-offer-details>

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

 events fired :
               | Event Name                           | Description              |
               |--------------------------------------|--------------------------|
               | vlocity-dc-open-edit-modal           |  Open the edit modal     |
               | vlocity-dc-delete-cart-offer         |  Delete item from cart   |
               | vlocity-dc-update-cart-offer         |  Update item from cart   |

events registered : none

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

Sample with slots -

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

List of available slots -

| Slot names                     | Dynamic     | Description                            | Impact                 |
|--------------------------------|-------------|----------------------------------------|------------------------|
| dc-shopping-details-wrapper    | -           | Wrapper for component                  | Replaces template DOM  |
| dc-extra-column-title          | -           | new column in sub total section        | Adds new column        |
| dc-extra-column-value          | -           | new column value in sub total section  | Adds new column        |

Extends

Members

(static) isOneTimeOverride

Method to fetch if one time override is applicable

(static) isRecurringOverride

Method to fetch if recurring override is applicable

(static) oneTimeTotal

Method to fetch one time total of an offer

(static) recurringTotal

Method to fetch recurring charge total of an offer

Methods

(static) configureLineItem()

Method to open edit modal

(static) connectedCallback()

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

(static) deleteOffer()

callback function for event vlocity-dc-remove-from-cart.
Trigger to close modal popup and delete offer

(static) getSDKInstance()

This function gets digital commerce sdk instance

(static) getTranslationLabels()

Method to get digital commerce SDK instance.

(static) showDeleteWarningModal()

Trigger to show modal popup

(static) updateQuantity()

Method to fire event 'vlocity-dc-update-cart-offer' to update offer