DCOfferAddons - Documentation

Publish date: 2024-05-05

Constructor

new DCOfferAddons()

Properties:
NameTypeDescription
paymentTypeStringpayment type value
apiUrlStringcustom end point URL.
catalogCodeStringto which child catalog code these offers are belongs to.
offerCodeStringto which child catalog code these offers are belongs to.
currentPlanGroupOfferProductGroupObjectcurrent plan group.
loadingBooleanboolean value to show and hide loader.
nextplanBtnBooleanboolean value to know whether child offers is available or not.
productGroupsAvailableBooleanboolean value to show whether product group is available or not.
isRecurringBooleanprice 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:
NameTypeDescription
inputobjectCurrent 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:
NameTypeDescription
responseobjectResponse Object from SDK call.

(static) addToCartSDKCall(input)

This function is used to make SDK call for addToCart

Parameters:
NameTypeDescription
inputobjectCurrent 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:
NameTypeDescription
errorobjectError 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:
NameTypeDescription
responseobjectSDK 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:
NameTypeDescription
inputobjectCurrent 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:
NameTypeDescription
responseobjectResponse Object from SDK call.

(static) getOfferSDKCalls(input)

This function is used to make SDK call for getOffer

Parameters:
NameTypeDescription
inputobjectCurrent 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:
NameTypeDescription
dataConfiguredChildOfferObjectconfigured offer object.
currentIndexNumberindex of current child product group.

(static) nextPlan()

Method to load the next child group.

(async, static) saveAddons(childOffer)

Configuring product to bundle.

Parameters:

(static) saveAddonsGetInput(childOffer)

This function is used to get saveAddons input object

Parameters:

(static) saveAddonsHandleFailure(error)

This function is used to handle saveAddons failure

Parameters:
NameTypeDescription
errorobjectError 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:
NameTypeDescription
responseobjectSDK 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:
NameTypeDescription
inputobjectCurrent 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:
NameTypeDescription
responseobjectResponse Object from SDK call.

(static) saveAddonsSDKCall(input)

This function is used to make SDK call for saveAddons

Parameters:
NameTypeDescription
inputobjectCurrent Input Object.

ncG1vNJzZmirlpm8brDOnKpnq2NjwrR51p6qrWViY66urdmopZqvo2OwsLmOj6Oom5mpxoWx1X2mnGecrLBwkKKInZ%2BdonaxpbvNrGWhrJ2h