VlocityDCOfferGroupSections

VlocityDCOfferGroupSections

vlocity-dc-offer-group-sections is a component that is used to render each item in offer group.

Constructor

new VlocityDCOfferGroupSections()

Properties:
Name Type Description
currentPlanGroup OfferProductGroupObject current plan group
loading Boolean boolean value to show and hide loader
showToast Boolean boolean value to show and hide toast message
isRecurring Boolean price type is recurring or one time.
Example
Sample Usage -

Include the component in your template simply by adding vlocity-dc-offer-group-sections custom tag

<vlocity-dc-offer-group-sections .offerCode="${"iPhoneX"}" .catalogCode="${"Phones"}"> .paymentType="${paymentChoiceStr}" ></vlocity-dc-offer-group-sections>

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

 events fired : vlocity-dc-route-navigation and vlocity-dc-refresh-offer-groups


 events registered :

               | Event Name                           | Event source component           | Callback Function      | Description                                   |
               |--------------------------------------|----------------------------------|------------------------|-----------------------------------------------|
               | vlocity-dc-event-source-basket       | vlocity-dc-edit-modal            | setEventSource()       | Event triggered to set event source           |
               | vlocity-dc-save-child-offers         | vlocity-dc-offer-group-selection | addToCart()            | Event triggered Configuring offer to bundle   |

 Dependency - vlocity-dc-offer-group-sections is an independent component that has no dependency on parent component.

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

Extends

  • LitElement

Members

(static, readonly) properties

Properties that will be available in the binding system
Properties:
Name Type Description
isRecurring Boolean price type is recurring or one time.
currentPlanGroup OfferProductGroupObject current plan group
loading Boolean boolean value to show and hide loader
showToast Boolean boolean value to show and hide toast message

Methods

(static) connectedCallback()

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

(async, static) getOfferDetails()

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

(static) getOfferDetailsGetInput()

This function is used to get getOfferDetails input object

(static) getOfferDetailsHandleFailure(error)

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

(static) getOfferDetailsPostHook(response)

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

(static) getOfferDetailsPreHook(input)

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

(static) getOfferDetailsPreSDKCalls()

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

(static) getOfferDetailsSDKCall(input)

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

(static) refreshProductGroups()

This function refreshes offer groups by firing vlocity-dc-refresh-offer-groups event .

(async, static) saveAddons(childProduct)

callback function for event vlocity-dc-save-child-offers.
Parameters:
Name Type Description
childProduct OfferObject offer to be validated.

(static) saveAddonsGetInput(childProduct)

This function is used to get addToCart input object
Parameters:
Name Type Description
childProduct object An object denoting current child product.

(static) saveAddonsHandleFailure(error)

This function is used to handle addToCart 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 addToCart 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 addToCart 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 addToCart SDK call is made.

(static) saveAddonsSDKCall(input)

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

(static) setCurrentPlanGroup(data)

callback function for event vlocity-dc-offer-group-sections.
Parameters:
Name Type Description
data ConfiguredOfferObject configured offer object.

(async, static) updateCart(offer)

This function is used to fetch all the offers
Parameters:
Name Type Description
offer object An object containing current offer.

(static) updateCartGetInput(catalogCode)

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

(static) updateCartHandleFailure(error)

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

(static) updateCartPostHook(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) updateCartPreHook(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) updateCartPreSDKCalls(input)

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

(static) updateCartProcessResponse(response)

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

(static) updateCartSdkCall(input)

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

(async, static) updateItemInBasket(offer)

This function is used to update item in basket
Parameters:
Name Type Description
offer object An object containing current offer.

(static) updateItemInBasketGetInput(catalogCode)

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

(static) updateItemInBasketHandleFailure(error)

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

(static) updateItemInBasketPostHook(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) updateItemInBasketPreHook(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) updateItemInBasketPreSDKCalls(input)

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

(static) updateItemInBasketProcessResponse(response)

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

(static) updateItemInBasketSdkCall(input)

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