DCPromotionList

DCPromotionList

c-dc-promotion-list is a web component used to display all available promotions.

Constructor

new DCPromotionList()

Properties:
Name Type Description
offerCode String offer code for which you want to see the list of all the available promotions.
catalogCode String catalog code.
appliedPromotions Promotion list of all the applied promotions.
Example
Sample Usage -

Include the component in your template simply by adding c-dc-promotion-list custom tag
<c-dc-promotion-list offerCode="${cartItem.productCode}" catalogCode="${shoppingCartComponent.catalogCode}" .appliedPromotions="${cartItem.promotions}"></c-dc-promotion-list>

| Attribute Name           | Type Expected                                                                       | Required |
|--------------------------|-------------------------------------------------------------------------------------|----------|
| offerCode                | It expects offer code value.                                                        | required |
| catalogCode              | It expects catalog code value.                                                      | required |
| appliedPromotions        | It expects list of all the applied promotions                                       | optional |

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

 events fired : vlocity-dc-promo-list-updated
             | Event Name                           | Description                                                   |
             |--------------------------------------|---------------------------------------------------------------|
             |vlocity-dc-promo-list-updated         | Event triggered on change of available promotion list         |

 events registered : none

 Dependency - c-dc-promotion-list is an independent component and has no dependency on parent component.

               | Parent Component | Expected Child Component  |
               |------------------|---------------------------|
               | none             | none                      |


Sample with slots -

<c-dc-promotion-list>
   <span slot="{slot_name}">
     Custom HTML elements goes here
   </span>
</c-dc-promotion-list>

List of available slots -

| Slot names                            | Dynamic     | Description                 | Impact               |
|---------------------------------------|-------------|----------------------------------------------------|
| dc-promotion-list-wrapper             | -           | Wrapper for template        | Replaces DOM         |
| dc-promotion-content-wrapper          | -           | Wrapper for content         | Replaces DOM         |

Extends

  • LitElement

Methods

(static) applyPromo()

Method to update apply promotions.

(static) fetchPromotions()

Method to fetch all promotions.

(static) getSDKInstance()

Method to get digital commerce SDK instance.

(static) getTranslationLabels()

Method to get digital commerce translations.