From: Vincent Vanwaelscappel Date: Fri, 14 Nov 2025 13:12:47 +0000 (+0100) Subject: wait #7834 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fb584dcf28b7fa88a64299368e8205d7003c844b;p=fluidbook-html5.git wait #7834 @1 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index db8d0384..61193a6a 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -266,6 +266,7 @@ FluidbookCartPuma.prototype = { exportPlanogramme: function () { + let $this = this; let GET = {}; $.each(this.exportData, function (k, v) { GET[v.name] = v.value; @@ -277,12 +278,21 @@ FluidbookCartPuma.prototype = { GET.pvp = 0; } this.fluidbook.displayLoader(); - this.fluidbook.hideLoader(3); - let url = this.fluidbook.service.getBaseURL(true) + 'puma/planogramme/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.cid + '/' + encodeURIComponent(this.getItemsReferences().join(',')) + '/pdf/' + encodeURIComponent(this.getExportFileName()) + '/' + (GET.pa == '1' ? '1' : '0') + '/' + (GET.pvp == '1' ? '1' : '0'); - console.log(url); - $("#puma_planogramme").remove(); - $("body").append(''); - $("#puma_planogramme").get(0).click(); + let refs = this.getItemsReferences().join(','); + let url = this.fluidbook.service.getBaseURL(true) + 'puma/planogramme/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.cid + '/pdf/' + encodeURIComponent(this.getExportFileName()) + '/' + (GET.pa == '1' ? '1' : '0') + '/' + (GET.pvp == '1' ? '1' : '0'); + + $.ajax({ + url: url, method: 'POST', data: {references: refs}, xhrFields: { + 'responseType': 'blob' + }, dataType: 'binary', success: function (data) { + var blob = new Blob([data]); + var link = document.createElement('a'); + link.href = window.URL.createObjectURL(blob); + link.download = $this.getExportFileName() + ".pdf"; + link.click(); + $this.fluidbook.hideLoader(2); + }, + }); }, exportPDF: function () {