IPhone 7

IPhone 7

iPhone 7 /8 Phone Case | Holz iPhone Hülle | iPhone Back Case | Geschenktipp | Perlmutt Phone Cover | Phone Accessories
NEU
18,97 EUR
inkl. 16% MwSt. zzgl. Versand
1 bis 16 (von insgesamt 18)
(function() { document.addEventListener('JSENGINE_INIT_FINISHED', function() { const endpointUrl = `${ jse.core.config.get('appUrl') }/shop.php?do=GoogleAnalyticsShop/addToCart` const hooks = { add: jse.libs.hooks.add, key: jse.libs.hooks.keys.shop.cart.add, callback: function(data) { return new Promise(handlePromise.bind(undefined, data)); }, }; function handlePromise(data, resolve) { const parameters = { quantity: data.products_qty, id: data.products_id, attributes: [], properties: [], }; function onSuccess(response) { if (!response.enabled) { resolve(); return; } gtag('event', 'add_to_cart', { "items": [JSON.parse(response.item)] }); resolve(); } function onFail() { resolve(); } if (data.properties_values_ids) { Object .entries(data.properties_values_ids) .forEach(function(entry) { parameters.properties.push({ optionId: entry[0], valueId: entry[1], }); }); } if (data.id) { Object .entries(data.id) .forEach(function(entry) { parameters.attributes.push({ optionId: entry[0], valueId: entry[1], }); }); } jse.libs.xhr.post({ url: endpointUrl, data: parameters, }) .then(onSuccess) .fail(onFail) } hooks.add(hooks.key, hooks.callback); }) })();