Here you will find the documentation about all the required and optional attributes for launching Easysize with your online shop.
Load our javascript library to all public facing pages, preferably before the closing <head>
tag.
(function(e, a, s, y){function i(e,s) {e=a.createElement("script");e.async=1;e.src=y;s=a.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s)}e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)};e.attachEvent?e.attachEvent("onload",i):e.addEventListener("load", i, false)})(window, document, "_easysize", "https://webapp.easysize.me/easysize.js")
_easysize('setAppId', 'YOUR_EASYSIZE_APP_ID');
_easysize('setSessionId', 'CURRENT_SESSION_ID_OF_USER');
// if user is logged in
_easysize('setUserId', 'USER_ID');
// if current page is product page
_easysize('setProductId', 'CURRENT_PRODUCT_FAMILY_ID');
You can use the global _easysize
object to tell us about other user interactions on the page.
The following should be added to your add to cart event handler on the front end. product id here corresponds the child product id that was added to cart.
_easysize('addItemCart', '<product_id>')