Constructor
new DCOfferGroupSections()
Properties:
Name | Type | Description |
---|---|---|
apiUrl |
String | custom end point URL. |
checkoutApiUrl |
String | custom checkout node server url |
currentPlanGroup |
OfferProductGroupObject | current plan group |
loading |
Boolean | boolean value to show and hide loader |
catalogCode |
String | to which child catalog code these offers are belongs to. |
offerCode |
String | to which child catalog code these offers are belongs to. |
isRecurring |
Boolean | price type is recurring or one time. |
Example
Sample Usage -
Include the component in your template simply by adding c-dc-offer-group-selection custom tag
<c-dc-offer-group-sections catalog-code={catalogCode} offer-code={offer.offerCode}></c-dc-offer-group-sections>
--------------------------------------------------------------------------------------------------------------------------------------
KEY INFO -
events fired : "vlocity-dc-refresh-edit-modal-content"
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 |
| vlocity-dc-event-source-basket | c-dc-shopping-cart | setEventSource() | Event triggered to set event source |
| | | | |
Dependency - c-dc-offer-group-sections 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-group-sections>
<span slot="{slot_name}">
Custom HTML elements goes here
</span>
</c-dc-offer-group-sections>
List of available slots -
| Slot names | Dynamic | Description | Impact |
|---------------------------------------|-------------|-----------------------------------------------------------|
| dc-offer-group-sections-wrapper | - | Wrapper for component | Replaces template DOM |
Extends
Methods
(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-group-sections is removed from the document’s DOM.
(static) findProductGroup()
Method to find product group to be edited
(async, static) getOffer()
This function get Offer details by calling getOffer method of sdk.
(static) getOfferGetInput()
Method to getgetOfferinput object
(static) getOfferHandleFailure(error)
This function is used to handle getOfferfailure
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 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 getOffercall can be written here
Parameters:
Name | Type | Description |
---|---|---|
input |
object | Current Input Object. |
(static) getOfferPreSDKCalls()
This function is used to execute any action before getOfferSDK call is made.
(static) getOfferProcessResponse(response)
This function is used to process getOfferresponse
Parameters:
Name | Type | Description |
---|---|---|
response |
object | Response Object from SDK call. |
(static) getOfferSDKCall(input)
This function is used to make SDK call forgetOffer
Parameters:
Name | Type | Description |
---|---|---|
input |
object | Current Input Object. |
(static) getSDKInstance()
This function gets digital commerce sdk instance
(static) initOfferGroupSections(data)
This function initialise the addons for the components.
Parameters:
Name | Type | Description |
---|---|---|
data |
ConfiguredOfferObject | configured offer object. |
(async, static) saveAddons(childOffer)
Configuring product to bundle.
Parameters:
Name | Type | Description |
---|---|---|
childOffer |
ConfiguredChildOfferObject | configured offer object. |
(static) saveAddonsGetInput()
Method to get saveAddons input object
(static) saveAddonsHandleFailure(error)
This function is used to handlesaveAddonsfailure
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 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 tosaveAddonscall 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 processsaveAddonsresponse
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. |
(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 getOffer call can be written here
Parameters:
Name | Type | Description |
---|---|---|
response |
object | Response Object from SDK call. |
(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. |