From dd3d128473994d59fd6775f964d3f1e731e99e08 Mon Sep 17 00:00:00 2001 From: Bharat Kunwar Date: Thu, 5 Dec 2024 10:39:13 +0000 Subject: [PATCH] CET-537/chore: Billing address should take precence over saved customerData --- .../js/view/payment/method-renderer/two_payment.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/view/frontend/web/js/view/payment/method-renderer/two_payment.js b/view/frontend/web/js/view/payment/method-renderer/two_payment.js index 6165d190..e2f09413 100755 --- a/view/frontend/web/js/view/payment/method-renderer/two_payment.js +++ b/view/frontend/web/js/view/payment/method-renderer/two_payment.js @@ -178,11 +178,6 @@ define([ }, fillCustomerData: function () { const self = this; - quote.shippingAddress.subscribe((address) => self.updateShippingAddress(address)); - this.updateShippingAddress(quote.shippingAddress()); - - quote.billingAddress.subscribe((address) => self.updateBillingAddress(address)); - this.updateBillingAddress(quote.billingAddress()); customerData .get('companyData') @@ -198,6 +193,12 @@ define([ .get('countryCode') .subscribe((countryCode) => self.fillCountryCode(countryCode)); this.fillCountryCode(customerData.get('countryCode')()); + + quote.shippingAddress.subscribe((address) => self.updateShippingAddress(address)); + this.updateShippingAddress(quote.shippingAddress()); + + quote.billingAddress.subscribe((address) => self.updateBillingAddress(address)); + this.updateBillingAddress(quote.billingAddress()); }, afterPlaceOrder: function () { const url = $.mage.cookies.get(config.redirectUrlCookieCode);