VlocityDCPromotionList

VlocityDCPromotionList

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

Constructor

new VlocityDCPromotionList()

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 vlocity-dc-promotion-list custom tag
<vlocity-dc-promotion-list offerCode="${cartItem.productCode}" catalogCode="${shoppingCartComponent.catalogCode}" .appliedPromotions="${cartItem.promotions}"></vlocity-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 fired on change of available promotions list            |

 events registered : none

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

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


Sample with slots -

<vlocity-dc-promotion-list>
   <span slot="{slot_name}">
     Custom HTML elements goes here
   </span>
</vlocity-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

Members

(static, readonly) properties

Properties that will be available in the binding system
Properties:
Name Type Description
promoData Array boolen value to show/hide filter box.
offerCode Array offer code.
catalogCode Array catalog code.

Methods

(async, static) fetchPromotions(catalogCode, offerCode)

This function is used to fetch all the offers
Parameters:
Name Type Description
catalogCode string catalog code.
offerCode string offer code.

(static) fetchPromotionsGetInput(catalogCode)

This function is used to get fetchPromotions input object
Parameters:
Name Type Description
catalogCode object An object containing current catalog.

(static) fetchPromotionsHandleFailure(error)

This function is used to handle fetchPromotions failure
Parameters:
Name Type Description
error object Error Object from SDK call.

(static) fetchPromotionsPostHook(response)

A custom function to be used by customers for customisation, any custom action after fetch offers call is successfull can be written here
Parameters:
Name Type Description
response object SDK Response object.

(static) fetchPromotionsPreHook(input)

A custom function to be used by customers for customisation, any custom action prior to fetch offers call can be written here
Parameters:
Name Type Description
input object Current Input Object.

(static) fetchPromotionsPreSDKCalls(input)

This function is used to execute any action before fetchPromotions SDK call is made.
Parameters:
Name Type Description
input object Current Input Object.

(static) fetchPromotionsProcessResponse(response)

This function is used to process fetchPromotions response
Parameters:
Name Type Description
response object Response Object from SDK call.

(static) fetchPromotionsSdkCall(input)

This function is used to make SDK call for fetchPromotions
Parameters:
Name Type Description
input object Current Input Object.

(static) updateCheckBox(context)

This function is called when a promotion is selected.
Parameters:
Name Type Description
context string details of selected promotion