Constructor
new DCOfferConfig()
Properties:
Name | Type | Description |
---|---|---|
catalog-code |
String | Catalog code. |
offer-code |
String | Offer code. |
Example
Sample Usage -
Include the component in your template simply by adding c-dc-offer-config HTML tag
<c-dc-offer-config catalog-code={catalogCode} offer-code={offerCode}></c-dc-offer-config>
| Attribute Name | Type Expected | Required |
|-------------------|---------------------------------------------------------------------------------|----------|
| catalog-code | It expects Catalog code as a string value. | required |
| | | |
| offer-code | It expects Offer code as a string value. | required |
--------------------------------------------------------------------------------------------------------------------------------------------------------------
KEY INFO -
events fired :
| Event Name | Description |
|----------------------------------|-------------------------------------------------|
| vlocity-dc-router | Routing event |
events registered :
| Event Name | Event source component | Callback Function | Description |
|-----------------------------------------|----------------------------------------------------------|------------------------|---------------------------------------------------|
| | Mutiple Event Sources: | | |
| | | Component Name | | | |
| vlocity-dc-configure-offer-attributes | |------------------------------| | configureOffer() | Event triggered when offer attributes are changed.|
| | | c-dc-offer-color-config | | | |
| | | c-dc-offer-input-config | | | |
| | | c-dc-offer-attribute-config | | | |
Dependency - c-dc-offer-config is an independent component and is commonly used as a parent component for multiple child components.
| Parent Component | Child Components |
|------------------|------------------------------|
| none | c-dc-media-viewer |
| | c-dc-offer-config-details |
| | c-dc-offer-group-sections |
Sample with slots -
<c-dc-offer-config>
<span slot="{slot_name}">
Custom HTML elements goes here
</span>
</c-dc-offer-config>
List of available slots -
| Slot names | Dynamic | Description | Impact |
|----------------------------|-------------|----------------------------------------------------|
| dc-offer-title | - | Offer Title | Replaces DOM |
| dc-offer-details | - | Wrapper for Offer Details | Replaces DOM |
Extends
Members
(static) catalogCode
setter for catalogCode.
(static) catalogCode
getter for catalogCode.
(static) offerCode
setter for offerCode.
(static) offerCode
getter for offerCode.
Methods
(async, static) addToCart()
Adding offer bundle to cart using SDK function addToCart() with basketAction = "AddAfterConfig"
(static) addToCartGetInput()
Method to get addToCart input object
(static) addToCartHandleFailure(error)
This function is used to handle addToCart failure
Parameters:
Name | Type | Description |
---|---|---|
error |
object | Error Object from SDK call. |
(static) addToCartPostHook(response)
A custom function to be used by customers for customisation, any custom action after addToCart call can be written here
Parameters:
Name | Type | Description |
---|---|---|
response |
object | SDK Response 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(cartResponse)
This function is used to process addToCart response
Parameters:
Name | Type | Description |
---|---|---|
cartResponse |
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. |
(async, static) configureOffer(configureOfferObject)
callback function for event vlocity-dc-configure-offer-attributes.
Parameters:
Name | Type | Description |
---|---|---|
configureOfferObject |
ConfigureOfferObject | object that contains field name and the value that needs to be configured. |
(static) configureOfferGetInput()
Method to get configureOffer input object
(static) configureOfferHandleFailure(error)
This function is used to handle configureOffer failure
Parameters:
Name | Type | Description |
---|---|---|
error |
object | Error Object from SDK call. |
(static) configureOfferPostHook(response)
A custom function to be used by customers for customisation, any custom action after configureOffer call can be written here
Parameters:
Name | Type | Description |
---|---|---|
response |
object | SDK Response object. |
(static) configureOfferPreHook(input)
A custom function to be used by customers for customisation, any custom action prior to configureOffer call can be written here
Parameters:
Name | Type | Description |
---|---|---|
input |
object | Current Input Object. |
(static) configureOfferPreSDKCalls()
This function is used to execute any action before configureOffer SDK call is made.
(static) configureOfferProcessResponse(response)
This function is used to process configureOffer response
Parameters:
Name | Type | Description |
---|---|---|
response |
object | Response Object from SDK call. |
(static) configureOfferSDKCall(input)
This function is used to make SDK call for configureOffer
Parameters:
Name | Type | Description |
---|---|---|
input |
object | Current Input Object. |
(static) connectedCallback()
Invoked when c-dc-offer-config component is added to the DOM.
(static) disconnectedCallback()
Invoked when c-dc-offer-config component is removed from the DOM.
(async, static) getOffer()
This function get Offer details by calling getOffer method of sdk.
(static) getOfferGetInput()
Method to get getOfferinput object
(static) getOfferHandleFailure(error)
This function is used to handlegetOfferfailure
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) getTranslationLabels()
Method to get digital commerce translations.
(static) routeToAddons()
Method for routing to addons.