Integration VIA Scripts
...
<script>
var widgetScript = document.createElement('script');
widgetScript.onload = function () {
_garderoboWidget.then(function(widget) {
widget.init('<API_KEY>', {lang_code: 'en', user_id: '<user_id>'});
});
};
widgetScript.src = 'https://widget.garderobo.ai/widget.js';
document.head.appendChild(widgetScript);
</script>
</body>_garderoboWidget.then(function(widget) {
//Get a list of all identifiers of items added to the cart
var cartProductsArray = [...]
//The second parameter should be passed the relative path to the cart page
widget.setCartProducts(cartProductsArray, '/cart/');
});Callback Functions
Event "Add item to cart"
Event "Add product to favorites"
Full Code
Last updated