From f67097932f4ed8ce996ae5b102b51e2a5fdb8a53 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 3 May 2023 07:25:31 +0200 Subject: [PATCH] Do not display empty customer information in the booking confirmation step. --- assets/js/pages/booking.js | 45 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index df4d5e26..a484a181 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -626,6 +626,7 @@ App.Pages.Booking = (function () { // Customer Details const firstName = App.Utils.String.escapeHtml($firstName.val()); const lastName = App.Utils.String.escapeHtml($lastName.val()); + const fullName = firstName + ' ' + lastName; const phoneNumber = App.Utils.String.escapeHtml($phoneNumber.val()); const email = App.Utils.String.escapeHtml($email.val()); const address = App.Utils.String.escapeHtml($address.val()); @@ -641,30 +642,30 @@ App.Pages.Booking = (function () { }), $('

', { 'html': [ - $('', { - 'text': lang('customer') + ': ' + firstName + ' ' + lastName - }), - $('
'), - $('', { + fullName ? $('', { + 'text': lang('customer') + ': ' + fullName + }) : null, + fullName ? $('
') : null, + phoneNumber ? $('', { 'text': lang('phone_number') + ': ' + phoneNumber - }), - $('
'), - $('', { + }) : null, + phoneNumber ? $('
') : null, + email ? $('', { 'text': lang('email') + ': ' + email - }), - $('
'), - $('', { - 'text': address ? lang('address') + ': ' + address : '' - }), - $('
'), - $('', { - 'text': city ? lang('city') + ': ' + city : '' - }), - $('
'), - $('', { - 'text': zipCode ? lang('zip_code') + ': ' + zipCode : '' - }), - $('
') + }) : null, + email ? $('
') : null, + address ? $('', { + 'text': lang('address') + ': ' + address + }) : null, + address ? $('
') : null, + city ? $('', { + 'text': lang('city') + ': ' + city, + }) : null, + city ? $('
') : null, + zipCode ? $('', { + 'text': lang('zip_code') + ': ' + zipCode + }) : null, + zipCode ? $('
') : null ] }) ]