File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Block/Adminhtml/Order/Create/Shipping
view/adminhtml/web/order/create Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,15 @@ public function getIsAsBilling()
8181 */
8282 public function getDontSaveInAddressBook ()
8383 {
84+ $ shippingIsTheSameAsBilling = $ this ->getIsAsBilling () && $ this ->getIsShipping ();
85+ $ params = $ this ->getRequest ()->getParams ();
86+ if ($ shippingIsTheSameAsBilling && $ params ) {
87+ $ save = $ params ['order ' ]['billing_address ' ]['save_in_address_book ' ] ?? false ;
88+ return !$ save ;
89+ }
90+ if ($ shippingIsTheSameAsBilling ) {
91+ return !($ this ->getIsAsBilling () && $ this ->getIsShipping ());
92+ }
8493 return $ this ->getIsAsBilling ();
8594 }
8695
@@ -121,6 +130,7 @@ public function getAddress()
121130
122131 /**
123132 * Return is address disabled flag
133+ *
124134 * Return true is the quote is virtual
125135 *
126136 * @return bool
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ define([
259259 data = data . toObject ( ) ;
260260
261261 if ( type === 'billing' && this . shippingAsBilling ) {
262- this . syncAddressField ( this . shippingAddressContainer , field . name , field . value ) ;
262+ this . syncAddressField ( this . shippingAddressContainer , field . name , field ) ;
263263 resetShipping = true ;
264264 }
265265
@@ -308,7 +308,11 @@ define([
308308
309309 $ ( container ) . select ( '[name="' + syncName + '"]' ) . each ( function ( element ) {
310310 if ( ~ [ 'input' , 'textarea' , 'select' ] . indexOf ( element . tagName . toLowerCase ( ) ) ) {
311- element . value = fieldValue ;
311+ if ( element . type === "checkbox" ) {
312+ element . checked = fieldValue . checked ;
313+ } else {
314+ element . value = fieldValue . value ;
315+ }
312316 }
313317 } ) ;
314318 } ,
You can’t perform that action at this time.
0 commit comments