Map shipping address phone number to billing phone field

This commit is contained in:
Emili Castells Guasch 2024-04-30 11:19:36 +02:00
parent 908c589d61
commit 59a230bd0b
2 changed files with 3 additions and 3 deletions

View file

@ -551,7 +551,8 @@ class AxoManager {
// Add addresses // Add addresses
this.setShipping(authResponse.profileData.shippingAddress); this.setShipping(authResponse.profileData.shippingAddress);
this.setBilling({ this.setBilling({
address: authResponse.profileData.card.paymentSource.card.billingAddress address: authResponse.profileData.card.paymentSource.card.billingAddress,
phoneNumber: authResponse.profileData.shippingAddress.phoneNumber.nationalNumber ?? ''
}); });
this.setCard(authResponse.profileData.card); this.setCard(authResponse.profileData.card);

View file

@ -42,7 +42,6 @@ class BillingView {
<div>${data.value('postCode')} ${data.value('city')}</div> <div>${data.value('postCode')} ${data.value('city')}</div>
<div>${valueOfSelect('#billing_state', data.value('stateCode'))}</div> <div>${valueOfSelect('#billing_state', data.value('stateCode'))}</div>
<div>${valueOfSelect('#billing_country', data.value('countryCode'))}</div> <div>${valueOfSelect('#billing_country', data.value('countryCode'))}</div>
<div>${valueOfSelect('#billing_phone', data.value('phone'))}</div>
</div> </div>
`; `;
}, },
@ -88,7 +87,7 @@ class BillingView {
}, },
phone: { phone: {
'selector': '#billing_phone_field', 'selector': '#billing_phone_field',
'valuePath': null 'valuePath': 'billing.phoneNumber'
} }
} }
}); });