DCOfferAddons

DCOfferAddons

DCOfferAddons is a component that contains offer addons.

Constructor

new DCOfferAddons()

Properties:
Name Type Description
paymentType String payment type value
apiUrl String custom end point URL.
catalogCode String to which child catalog code these offers are belongs to.
offerCode String to which child catalog code these offers are belongs to.
currentPlanGroup OfferProductGroupObject current plan group.
loading Boolean boolean value to show and hide loader.
nextplanBtn Boolean boolean value to know whether child offers is available or not.
productGroupsAvailable Boolean boolean value to show whether product group is available or not.
isRecurring Boolean price type is recurring or one time.
Example
Sample Usage -

Include the component in your template simply by adding c-dc-offer-addons custom tag

<c-dc-offer-addons catalog-code={catalogCode} offer-code={offerCode}></c-dc-offer-addons>

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

 events fired :
               | Event Name                       | Description                                |
               |----------------------------------|--------------------------------------------|
               | vlocity-dc-router                | Event triggered when routing to addons     |

 events registered :

               | Event Name                    | Event source component        | Callback Function      | Description                                   |
               |-------------------------------|-------------------------------|------------------------|-----------------------------------------------|
               | vlocity-dc-save-child-offers  | c-dc-offer-group-selection    | saveAddons()           | Event triggered Configuring product to bundle |

 Dependency - c-dc-offer-addons is an independent component that has no dependency on parent component.

               | Parent Component | Expected Child Component    |
               |------------------|-----------------------------|
               | none             | c-dc-offer-group            |

 Sample with slots -

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

List of available slots -

| Slot names                    | Dynamic     | Description                  | Impact               |
|-------------------------------|-------------|------------------------------|----------------------|
| dc-offer-addon-wrapper        | -           | Wrapper for template         | Replaces DOM         |
| dc-addons-next-btn            | -           | Button container             | Replaces DOM         |

Extends

Methods

(async, static) addToCart()

Adding offer to the cart.

(static) addToCartGetInput()

This function is used to get addToCart input object

(static) addToCartPreHook(input)

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

(static) addToCartPreSDKCalls()

This function is used to execute any action before addToCart SDK call is made.

(static) addToCartProcessResponse(response)

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

(static) addToCartSDKCall(input)

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

(static) connectedCallback()

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

(static) disconnectedCallback()

disconnectedCallback () is invoked when c-dc-offer-addons is removed from the document’s DOM.

(async, static) getOffer()

This function get Offer details by calling getOffer method of sdk.

(static) getOfferGetInput()

This function is used to get getOffer input object

(static) getOfferHandleFailure(error)

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

(static) getOfferPostHook(response)

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

(static) getOfferPreHook(input)

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

(static) getOfferPreSDKCalls()

This function is used to execute any action before getOffer SDK call is made.

(static) getOfferProcessResponse(response)

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

(static) getOfferSDKCalls(input)

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

(static) getSDKInstance()

This function gets digital commerce sdk instance

(static) getTranslationLabels()

Method to get digital commerce translations.

(static) initUpdateOffer(data, currentIndex)

Method to update the dom with given child offer.
Parameters:
Name Type Description
data ConfiguredChildOfferObject configured offer object.
currentIndex Number index of current child product group.

(static) nextPlan()

Method to load the next child group.

(async, static) saveAddons(childOffer)

Configuring product to bundle.
Parameters:
Name Type Description
childOffer ConfiguredChildOfferObject configured offer object.

(static) saveAddonsGetInput(childOffer)

This function is used to get saveAddons input object
Parameters:
Name Type Description
childOffer ConfiguredChildOfferObject configured offer object.

(static) saveAddonsHandleFailure(error)

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

(static) saveAddonsPostHook(response)

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

(static) saveAddonsPreHook(input)

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

(static) saveAddonsPreSDKCalls()

This function is used to execute any action before saveAddons SDK call is made.

(static) saveAddonsProcessResponse(response)

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

(static) saveAddonsSDKCall(input)

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