Default billing and shipping to NOT be the same

How can we set the default so that the “My billing and shipping address are the same” as NOT checked. Right now the default is checked. Thanks!

3 answers

Profile photo of Mall Staff 184060.00 $tone March 18, 2021
Public

Hi there,

How can we set the default so that the “My billing and shipping address are the same” as NOT checked. 

You can implement that using the following quick workaround:

1. Open the Javascript file at: app/code/Ubertheme/Checkout/view/frontend/web/js/view/billing-address.js
and find the code lines:

afterResolveDocument: function () {
this.saveBillingAddress();
//initial google auto complete if it was enabled
if (window.checkoutConfig.ubCheckoutConfig.googleAutoCompleteEnabled) {
new googleAddressAutoComplete('billing');
}
},

and replace it with:

afterResolveDocument: function () {
this.saveBillingAddress();
//initial google auto complete if it was enabled
if (window.checkoutConfig.ubCheckoutConfig.googleAutoCompleteEnabled) {
new googleAddressAutoComplete('billing');
}
this.isAddressSameAsShipping(false);
},

2. Then re-deploy static files in your site and clean the M2 cache.

Regards,
Mall.

#1
Profile photo of myblankee 160.00 $tone March 18, 2021
Public

Wonderful, thank you so much! If anyone else wants to modify this without modifying the plugin itsel, you can copy the billing-address.js and put it into your theme/Ubertheme_Checkout/web/js/view/billing-address.js and then cleaning cache didn’t seem to work for me so I deleted everything in the pub/static directory except for the .htaccess file and then redeployed the static files and everything worked wonderfully well.
Thank you Mall for the help!

#2
Profile photo of ubdev Staff 98150.00 $tone March 18, 2021
Public

Hi there, 
 
We’re glad that it helped. 
 
If you have any additional questions, please get back to us here. 
 
Meanwhile, we wonder if you have any new M2 project that needs a new theme. Please take a look at our UB Atoms here -- our 1st premium M2 theme in 2021 to see if it’s a good fit. This theme has been entirely revamped not like any of our previous M2 theme. 
 
PS. We’d like to offer you 20%OFF if you decide to try the UB Atoms theme. 
 
Regards,
Ubertheme team
 
 
 
 

#3

Please login or Register to Submit Answer

Written By

Comments