For each shoe, add this tag at the position in the HTML where the Size Advisor button should be displayed:

      <div class="ShoeSizeMe" data-shoeid="SHOE_ID"></div>

Add this script at the end of the html code.

      <script type="text/javascript">
        (function(d, t, s) {

          // Replace the following variables
          var shopId = "SHOP_ID";
          var locale = "en";
          var scale  = "uk";
          // Do not modify
          var a = d.createElement(t);
          var f = d.getElementsByTagName(t)[0];
          a.async = 1;
          a.src = s;
          a.text ='{shopID:"'+shopId+'",locale:"'+locale+'",scale:"'+scale+'"}';
          f.parentNode.insertBefore(a, f);
        })(document, 'script', '');

Since you are adding multiple buttons for each product, make sure that only the button of the visible shoe is displayed.

If only the sizes or other details are replaced, but the area where the buttons are remains unchanged, you need to call ShoeSizeMe.checkAvailability("shoeID") after the new details have been loaded and hide the button for the shoe that was active before and display the new one. This could look like this (using jQuery):

      <script type="text/javascript">
        // hide old button
        // show new button
        // check size availability

Your browser is out of date!

Update your browser to view this website correctly. Update my browser now