The Callbacks (for both PDP and PLP Experiences)

Here are the different callback functions that can be used to get the data required for different shopper experiences e.g. Add to cart functions, get a recommended size, size availability, etc.

There are 3 possible callbacks that can be used to trigger different experiences for your shoppers on both the PDP and PLP.

  1. newRecommendation
  2. inCart
  3. alternatives (if the size is unavailable or not produced, you can use this to re-direct or initiate another CTA)
<script type="text/javascript" async src="https://shoesize.me/assets/plugin/loader.js">
{
shopID:"SHOP_ID",
locale:"en",
zeroHash:"xxxxxxxxxx",
scale:"eu",
newRecommendation: yourRecommendationHandler,
inCart: yourAddToCartHandler,
alternatives: yourAlternativeHandler
}
</script>

 

// CALLBACKS HANDLERS EXAMPLE

<script>
function yourRecommendationHandler(recommendation){
console.log(recommendation);
}
function yourAddToCartHandler(recommendation){
console.log(recommendation);
}
function yourAlternativeHandler(recommendation){
console.log(recommendation);
}
</script>