@@ -694,14 +694,14 @@ protected function _prepareCustomerQuote($quote)
694
694
$ hasDefaultBilling = true ;
695
695
}
696
696
}
697
- //save here new customer address
698
- $ shippingAddress ->setCustomerId ($ quote ->getCustomerId ());
699
697
if (!$ shippingAddress ->getId ()) {
698
+ //save here new customer address
699
+ $ shippingAddress ->setCustomerId ($ quote ->getCustomerId ());
700
700
$ this ->addressRepository ->save ($ shippingAddress );
701
+ $ quote ->addCustomerAddress ($ shippingAddress );
702
+ $ this ->addressesToSync [] = $ shippingAddress ->getId ();
701
703
}
702
- $ quote ->addCustomerAddress ($ shippingAddress );
703
704
$ shipping ->setCustomerAddressData ($ shippingAddress );
704
- $ this ->addressesToSync [] = $ shippingAddress ->getId ();
705
705
$ shipping ->setCustomerAddressId ($ shippingAddress ->getId ());
706
706
}
707
707
}
@@ -729,13 +729,13 @@ protected function _prepareCustomerQuote($quote)
729
729
}
730
730
$ billingAddress ->setIsDefaultBilling (true );
731
731
}
732
- $ billingAddress ->setCustomerId ($ quote ->getCustomerId ());
733
732
if (!$ billingAddress ->getId ()) {
733
+ $ billingAddress ->setCustomerId ($ quote ->getCustomerId ());
734
734
$ this ->addressRepository ->save ($ billingAddress );
735
+ $ quote ->addCustomerAddress ($ billingAddress );
736
+ $ this ->addressesToSync [] = $ billingAddress ->getId ();
735
737
}
736
- $ quote ->addCustomerAddress ($ billingAddress );
737
738
$ billing ->setCustomerAddressData ($ billingAddress );
738
- $ this ->addressesToSync [] = $ billingAddress ->getId ();
739
739
$ billing ->setCustomerAddressId ($ billingAddress ->getId ());
740
740
741
741
// Admin order: `Same As Billing Address`- when new billing address saved in address book
0 commit comments