File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
app/code/Magento/QuoteGraphQl/Model/Cart Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,11 @@ private function createShippingAddress(
98
98
$ shippingAddress = $ this ->quoteAddressFactory ->createBasedOnInputData ($ addressInput );
99
99
100
100
// need to save address only for registered user and if save_in_address_book = true
101
- if (0 !== $ customerId && !empty ($ addressInput ['save_in_address_book ' ])) {
101
+ if (
102
+ 0 !== $ customerId
103
+ && isset ($ addressInput ['save_in_address_book ' ])
104
+ && (bool )$ addressInput ['save_in_address_book ' ] === true
105
+ ) {
102
106
$ this ->saveQuoteAddressToCustomerAddressBook ->execute ($ shippingAddress , $ customerId );
103
107
}
104
108
} else {
Original file line number Diff line number Diff line change @@ -113,7 +113,11 @@ private function createBillingAddress(
113
113
114
114
$ customerId = $ context ->getUserId ();
115
115
// need to save address only for registered user and if save_in_address_book = true
116
- if (0 !== $ customerId && !empty ($ addressInput ['save_in_address_book ' ])) {
116
+ if (
117
+ 0 !== $ customerId
118
+ && isset ($ addressInput ['save_in_address_book ' ])
119
+ && (bool )$ addressInput ['save_in_address_book ' ] === true
120
+ ) {
117
121
$ this ->saveQuoteAddressToCustomerAddressBook ->execute ($ billingAddress , $ customerId );
118
122
}
119
123
} else {
You can’t perform that action at this time.
0 commit comments