HTML demo
This is a demo of an integration and should not be copy/pasted for a production integration.
Last updated
This is a demo of an integration and should not be copy/pasted for a production integration.
Last updated
This HTML template showcases the following features:
XCE Script Integration: The template seamlessly integrates the XCE script into the page's <head>
section, establishing a connection with the XCE platform.
Standard Signal Utilization: The template effectively employs standard XCE signals, namely set
and listen
, to interact with the XCE platform.
set
signal: The set
signal is utilized to request a quote from the XCE platform, configure currency formatting and render the checkout order total. Upon successful quote retrieval, the template stores the quote response and element is rendered. In case of an error, it logs the error message to the developer console and element is hidden.
listen
signal: The listen
signal keeps track of the selected option and logs the selected option and in case the option selected was the 'Yes' option it also logs the previously stored quote response to the developer console.
Custom CTA for Error Handling: The template showcases a custom CTA button that programmatically updates the element state to an error state if no option was previously selected, highlighting the importance of making a selection before proceeding.
To utilize this template, copy and paste it into your IDE, save it as an .html
file, and open it in your web browser. Don't forget to open your DevTools!
This is an example of what you should be seeing: