Script manual launch

In some occasions, you may need to delay or control when the Usizy script load starts your on product pages, for different reasons as in the example below:

  • The platform.min.js is loaded before the actual variables from the script, because of the way your script is injected in your code.
  • When visitors navigate within a product, from one product variation to the next, and your page is not fully reloaded.

In such a case, the variables from our script are not reloaded and updated, unless you initiate the script load manually.

To control the start of this event manually, you may use the optional “data-manual_init” function, to make sure the script load only starts when you need it to.

  • Add the usizy-external variables into your page, as in the example below:
    <div class="usizy-external"
    data-layout="link"
    data-width="100%"
    data-language="en"
    data-sizesystem="UK"
    data-product="item_group_id"
    data-price-vat="price-including-taxes"
    data-price-no-vat="price-excluding-taxes"
    data-guidelink="your size guide url here">
    </div>
    
  • Include the following script after the variables :
<script data-manual_init="true" src="https://static.usizy.es/js/platform.min.js"></script>
  • Once the previous steps are completed and the variables and script appear in your pre, you may initialize the API call using the following command:
window.uSizy.init()