From: Vincent Vanwaelscappel Date: Mon, 6 May 2024 16:41:44 +0000 (+0200) Subject: wait #6895 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1d2d7170cda7e06cfa83ebd96682cd325fc85c56;p=fluidbook-html5.git wait #6895 @1 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js b/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js index 3f266766..7972062c 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js @@ -31,9 +31,11 @@ FluidbookCartBastideResah.prototype = { $(document).on(this.fluidbook.input.clickEvent, '#Bastide_cart [data-validate-cart]', function (event) { event.preventDefault(); - $.ajax('https://bastide-resah.fluidbook.com/fluidbook/order', { + $.ajax('/fluidbook/order', { method: 'POST', data: {details: $this.getItems()}, + }).done(function (data) { + $this.fluidbook.stats.trackEcommerceOrder([data.order, data.total]); }); $this.fluidbook.menu.quickCloseView(); diff --git a/js/libs/fluidbook/fluidbook.stats.js b/js/libs/fluidbook/fluidbook.stats.js index 25e407fd..a9bdfa37 100644 --- a/js/libs/fluidbook/fluidbook.stats.js +++ b/js/libs/fluidbook/fluidbook.stats.js @@ -148,6 +148,7 @@ FluidbookStats.prototype = { break; case 15:// this.matomoPush(['trackEvent', 'cart', 'addproduct', extra]); + this.matomoPush(['setEcommerceView', extra]); } }, @@ -457,6 +458,9 @@ FluidbookStats.prototype = { } }, + trackEcommerceOrder: function (orderId, total) { + this.matomoPush(['trackEcommerceOrder', orderId, total]); + }, trackGoogleAnalytics: function (type, page, extra, url) { this.checkGoogleAnalytics();