From 45f64344745d22f39249c1e9fedf257e5b2274cb Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 29 Jan 2026 15:10:58 +0100 Subject: [PATCH] wip #7957 --- .../fluidbook/cart/fluidbook.cart.newheidi.js | 41 ++++++++----- style/cart/newheidi.less | 60 +++++++++++++++++-- 2 files changed, 80 insertions(+), 21 deletions(-) diff --git a/js/libs/fluidbook/cart/fluidbook.cart.newheidi.js b/js/libs/fluidbook/cart/fluidbook.cart.newheidi.js index e7559fa7..7dd89572 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.newheidi.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.newheidi.js @@ -5,6 +5,7 @@ function FluidbookCartNewHeidi(cart) { this.showAddToCartTooltips = false; this.items = {}; this.formDataStorage = {}; + this.ps = null; this.totalHT = 0; this.tva = 0; this.totalTTC = 0; @@ -27,6 +28,7 @@ FluidbookCartNewHeidi.prototype = { $(document).on(this.fluidbook.input.clickEvent, '#open-request', function () { $this.fluidbook.menu.quickCloseView(); $this.getContactForm(); + resize(); return false; }); @@ -34,7 +36,7 @@ FluidbookCartNewHeidi.prototype = { $this.sendRequest(); }); - $(document).on(this.fluidbook.input.changeEvent, '#kimplay-sendcart-form input, #kimplay-sendcart-form textarea', function() { + $(document).on(this.fluidbook.input.changeEvent, '#newheidi-sendcart-form input, #newheidi-sendcart-form textarea', function() { $this.formDataStorage[$(this).attr('name')] = $(this).val() $this.fluidbook.cache.set('formData', $this.formDataStorage); }); @@ -94,6 +96,7 @@ FluidbookCartNewHeidi.prototype = { this.items.splice(key, 1); } this.save(); + this.updateTotals() }, save: function () { @@ -196,9 +199,10 @@ FluidbookCartNewHeidi.prototype = { }, openCart: function (p2, callback) { - this._endMenu(this.fluidbook.l10n.__('my selection'), this.getCartContent(), function () { + this._endMenu(this.fluidbook.l10n.__('mon panier'), this.getCartContent(), function () { callback(); }); + setTimeout(() => this.ps.update(), 500) }, getCartContent: function () { @@ -207,7 +211,7 @@ FluidbookCartNewHeidi.prototype = { } var $this = this; - var content = ''; + var content = '
'; content += ''; content += ''; content += ''; @@ -240,7 +244,7 @@ FluidbookCartNewHeidi.prototype = { }); content += ''; - content += '
' + this.fluidbook.l10n.__('réf') + '
'; + content += ''; content += ''; @@ -271,6 +275,7 @@ FluidbookCartNewHeidi.prototype = { view += ''; view += ''; this.fluidbook.menu.viewWrap(view, 'cart'); + this.ps = new PerfectScrollbar("#newheidicart .content"); $("#wrap-newheidicart").perfectScrollbar(); callback(); }, @@ -311,13 +316,14 @@ FluidbookCartNewHeidi.prototype = { 'mail':'', 'phone':'', 'address':'', + 'delivery_date':'', } } - let view = `
+ let view = `
${this.fluidbook.menu.getCaption("Mes coordonnées", 'small')}
-
+
@@ -344,6 +350,10 @@ FluidbookCartNewHeidi.prototype = {

+
+ + +

@@ -352,22 +362,22 @@ FluidbookCartNewHeidi.prototype = {
`; - this.fluidbook.menu.openCustomView(view, 'cart-kimplay-sendcart'); + this.fluidbook.menu.openCustomView(view, 'cart-newheidi-sendcart'); $(".mview .content").perfectScrollbar(); }, getConfirm: function () { - return `

Votre demande a bien été transmise. - Une copie de votre sélection va vous être adressée par email par l'équipe commerciale. + return `

Votre demande a bien été transmise. Une copie de votre sélection va vous être adressée par email. + Notre équipe commerciale reviendra vers vous dans les plus brefs délais.

- D’ici là nous restons joignables pour toute - question à l’adresse : info@cofalu.com + D’ici là nous restons joignables pour toute
+ question à l’adresse : info@newheidi.com

` }, @@ -396,10 +406,11 @@ FluidbookCartNewHeidi.prototype = { $this.emptyCart(); $this.updateTitle('Merci !') $this.updateCartContent($this.getConfirm()) - $this.fluidbook.resize.resize(); - $("[data-menu=newheidi-sendcart], #newheidi-sendcart").addClass("confirm") + resize(); + $("[data-menu=cart-newheidi-sendcart], #newheidi-sendcart").addClass("confirm") }, error: function (xhr, status, error) { + console.log(xhr, error) let errorsMessage = JSON.parse(xhr.responseText); $this.displayErrors(errorsMessage) }, diff --git a/style/cart/newheidi.less b/style/cart/newheidi.less index 9e230396..af9b2379 100644 --- a/style/cart/newheidi.less +++ b/style/cart/newheidi.less @@ -23,6 +23,10 @@ font-family: @font; width: 100% !important; + @media @breakpoint { + top: 0 !important; + } + &[data-menu=cart-newheidi-qty] { max-width: 614px !important; } @@ -32,20 +36,34 @@ } &[data-menu=cart-newheidi-sendcart] { - max-width: 680px !important; - min-width: 680px !important; + max-width: 725px !important; + min-width: 725px !important; @media @breakpoint { max-width: 1024px !important; + min-width: 100% !important; } &.confirm { max-width: max-content !important; min-width: auto !important; padding: 41px 50px; + + .caption { + padding-right: 0; + padding-left: 0; + } + + .content { + padding: 0; + } } } + * { + letter-spacing: 1px; + } + .caption { height: auto; padding: 30px 0; @@ -74,6 +92,7 @@ .fonctions { float: none; padding-top: 60px; + padding-bottom: 50px; padding-right: 0; font-size: 14px; font-weight: bold; @@ -94,6 +113,10 @@ .sendRequest { width: 250px; text-align: center; + + @media @breakpoint { + width: 100%; + } } } @@ -129,6 +152,9 @@ border: 2px solid #000; background-color: #fff; color: #000; + text-align: center; + padding-right: 0; + padding-left : 0; } .sendRequest { @@ -183,6 +209,10 @@ table-layout: fixed; min-width: 800px; + @media @breakpoint { + min-width: 1023px; + } + th { text-transform: uppercase; padding: 16px 13px; @@ -269,7 +299,7 @@ display: flex; justify-content: center; align-items: center; - margin: 0 auto; + margin: 0 12px 0 auto; left: 0; } @@ -326,6 +356,7 @@ font-size: 13px; margin: 0; width: auto; + padding: 0; } } @@ -334,9 +365,18 @@ justify-content: space-between; padding-right: 40px; + @media @breakpoint { + flex-direction: column; + padding-right: 0; + } + .shipping-text { line-height: 18px; + @media @breakpoint { + margin-bottom: 30px; + } + p { text-transform: initial; } @@ -346,6 +386,10 @@ line-height: 28px; width: 200px; + @media @breakpoint { + align-self: flex-end; + } + p { display: flex; justify-content: space-between; @@ -404,16 +448,20 @@ } input, textarea { - width: 380px; + width: 395px; text-align: left; padding: 5px 10px; - font-size: 14px; + font-size: 13px; @media @breakpoint { width: 100%; } } + input { + height: 30px; + } + textarea { height: 80px; resize: none; @@ -467,7 +515,7 @@ } [class^=ps__thumb] { - background-color: #fff; + background-color: #000; } .ps__thumb-y { -- 2.39.5