File tree 1 file changed +13
-2
lines changed
app/code/Magento/Checkout/view/frontend/web/js/model
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -219,15 +219,26 @@ define([
219
219
*/
220
220
applyBillingAddress : function ( ) {
221
221
var shippingAddress ;
222
+ var isBillingAddressInitialized ;
222
223
223
224
if ( quote . billingAddress ( ) ) {
224
225
selectBillingAddress ( quote . billingAddress ( ) ) ;
225
226
226
227
return ;
227
228
}
228
- shippingAddress = quote . shippingAddress ( ) ;
229
+ shippingAddress = quote . billingAddress ( ) ;
230
+ if ( quote . isVirtual ( ) ) {
231
+ isBillingAddressInitialized = addressList . some ( function ( addrs ) {
232
+ if ( addrs . isDefaultBilling ( ) ) {
233
+ selectBillingAddress ( addrs ) ;
234
+ return true ;
235
+ }
236
+ return false ;
237
+ } ) ;
238
+ }
229
239
230
- if ( shippingAddress &&
240
+ if ( ! isBillingAddressInitialized &&
241
+ shippingAddress &&
231
242
shippingAddress . canUseForBilling ( ) &&
232
243
( shippingAddress . isDefaultShipping ( ) || ! quote . isVirtual ( ) )
233
244
) {
You can’t perform that action at this time.
0 commit comments