File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/code/Magento/Quote/Model Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -674,7 +674,10 @@ protected function _prepareCustomerQuote(Quote $quote)
674
674
}
675
675
676
676
if ((!$ billing ->getCustomerId () || $ billing ->getSaveInAddressBook ())
677
- && ($ shipping && (!$ shipping ->getSameAsBilling () || !$ shipping ->getCustomerAddressId ()))) {
677
+ && (
678
+ $ shipping === null
679
+ || ($ shipping && (!$ shipping ->getSameAsBilling () || !$ shipping ->getCustomerAddressId ()))
680
+ )) {
678
681
if ($ billing ->getQuoteId ()) {
679
682
$ billingAddress = $ billing ->exportCustomerAddress ();
680
683
} else {
@@ -705,14 +708,14 @@ protected function _prepareCustomerQuote(Quote $quote)
705
708
$ billing ->setCustomerAddressId ($ billingAddress ->getId ());
706
709
707
710
// Admin order: `Same As Billing Address`- when new billing address saved in address book
708
- if (! empty ( $ shipping)
711
+ if ($ shipping !== null
709
712
&& !$ shipping ->getCustomerAddressId ()
710
713
&& $ shipping ->getSameAsBilling ()) {
711
714
$ shipping ->setCustomerAddressId ($ billingAddress ->getId ());
712
715
}
713
716
}
714
717
}
715
- if (! empty ( $ shipping) && $ shipping ->getSameAsBilling () && !$ billing ->getCustomerAddressId ()) {
718
+ if ($ shipping !== null && $ shipping ->getSameAsBilling () && !$ billing ->getCustomerAddressId ()) {
716
719
$ billing ->setCustomerAddressId ($ shipping ->getCustomerAddressId ());
717
720
}
718
721
if ($ shipping && !$ shipping ->getCustomerId () && !$ hasDefaultBilling ) {
You can’t perform that action at this time.
0 commit comments