Skip to main content

Add callback functions

info

Our widget uses some callback functions to extend the functionality. Since the widget does work without using callback functions we do recommend to use these functions for a better user experience. Here is a brief overview of which callback functions can be used.

Select suggested frame size

To automatically select the frame size suggested in the widget on the product page (e.g. in a dropdown menu), you can set up a custom function triggered by the confirmSize callback. More information on how to use the function you will find here.

Check if sizing widget is available

The sizing widget only works if the requested product code is available in our database. We have two callbacks available to handle scenarios around the fact a product code is available in our database or not. sizingAvailable will be fired if the product code is found in our database wherelse sizingUnavailable will be fired if the code is not found. Usually using one of these callbacks is enough. For example, you could hide the button when sizingUnavailable is triggered, or you could hide the button by default and show it when sizingAvailable is triggered. If the product code is not available and you don't hide the button it simply won't work and may confuse the customer. More information on how to use the function you will find here.

Check availabilty

The sizing widget can show a different result screen depending on the availabilty of the product so the customer directly knows if the product is available or not. This only works if you send information about the availability to the widget with the checkIsAvailable callback. More information on how to use the function you will find here.

info

If you use the Recommendation Engine the availabilty will be checked based on the provided product feed and therefore this callback has no function.

Usage insights

The usageInsights callback is designed to give you a good understanding, how your customers are using the Sizing Widget and provide you with valuable information which can be used for google analytics or similar. More information on how to use the function you will find here.