I just want the My billing and shipping address are the same checkbox to be unchecked by default and let the customer see the form to enter a new billing address.

I think the answer lies within this file: Magento_Checkout/web/js/view/billing-address.js

But I've tried an awful lot of things with no success.

I need to set isAddressSameAsShipping to false?

I mean I can just uncheck it using JavaScript, but that just seems like cheating..


  • You can do it using javascript, if its working using js no problem for form Nov 21, 2016 at 10:15

3 Answers 3


Override ..vendor/magento/module-payment/view/frontend/web/transparent.js and add this code :

var paymentMethodId = jQuery(".payment-methods input[type='radio']:checked").attr('id');

jQuery(".payment-method").find('select[name="billing_address_id"]  option:last-child').attr('selected','selected');

Override ../magento/module-checkout/view/frontend/web/js/action/set-billing-address.js: (Add code)

         console.log(   jQuery(this).find('input[name="billing-address-same-as-shipping"]').is(":checked") );             
         console.log(jQuery(this).find('select[name="billing_address_id"]  option:last-child'));
         jQuery(this).find('select[name="billing_address_id"]  option:last-child').attr('selected','selected');
  • Rather dissappointing answer. The question clearly stated not to use Javascript.
    – leedch
    Feb 6, 2017 at 10:34
  • 1
    You can use as alternative solution , Its not the way to down-vote any answer @leedch Feb 6, 2017 at 13:42

I am copy/pasting my answer from Magento 2 : Uncheck My billing and shipping address are the same checkbox in checkout payment page based on shipping method

Disclaimer: I am an author of an article at the end of this answer.

Magento best practices way.

  1. Create a simple Magento 2 extension.
  2. Create a file app/code/Vendor/Module/view/frontend/requirejs-config.js with the content:

    var config = {
     map: {
     '*': {
       'Magento_Checkout/js/model/checkout-data-resolver': 'Vendor_Module/js/checkout-data-resolver',
       'Magento_Checkout/js/model/shipping-save-processor/default': 'Vendor_Module/js/shipping-save-processor/default'
  3. Copy file vendor/magento/module-checkout/view/frontend/web/js/model/checkout-data-resolver.js to app/code/Vendor/Module/view/frontend/web/js/checkout-data-resolver.js.
  4. Edit file app/code/Vendor/Module/view/frontend/web/js/checkout-data-resolver.js and comment out code around line 231:

        applyBillingAddress: function () {
            var shippingAddress;
            if (quote.billingAddress()) {
            shippingAddress = quote.shippingAddress();
            /*if (shippingAddress &&
                shippingAddress.canUseForBilling() &&
                (shippingAddress.isDefaultShipping() || !quote.isVirtual())
            ) {
  5. Copy file vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor/default.js to app/code/Vendor/Module/view/frontend/web/js/shipping-save-processor/default.js.

  6. In app/code/Vendor/Module/view/frontend/web/js/shipping-save-processor/default.js comment out code around line 34:

    saveShippingInformation: function () {
    var payload;
    /*if (!quote.billingAddress()) {
    payload = {
  7. Delete folder pub/static/frontend:

     rm -rf pub/static/frontend
  8. Regenerate static content:

     php bin/magento setup:static-content:deploy
  9. Clear magento cache and you are all set.

Dirty way

Instead of steps 1 through 6 simply edit the file vendor/magento/module-checkout/view/frontend/web/js/model/checkout-data-resolver.js and comment out code around line 231 as in step 4 and edit the file vendor/magento/module-checkout/view/frontend/web/js/model/shipping-save-processor/default.js and comment code code around line 34 as in step 6.

Repeat steps 7,8,9.

Originally published as https://www.goivvy.com/blog/magento-2-set-billing-shipping-address-unchecked-default-checkout


I have traced the code that sets the default value for the SameAsBilling attribute in the Quote\Address model.

The $address->setSameAsBilling(1) is called in Quote\Address::_populateBeforeSaveData() which in turn is called in Quote\Address::beforeSave()

The below solution works for the backend sale, where the order form comes with the selected checkbox, which makes the data input very cumbersome, since after each field is populated, theres a loading period for syncing the fields.

I have created a Plugin for the Quote\Address, as follows:


<type name="Magento\Quote\Api\Data\AddressInterface">
    <plugin name="cinch_ticketsale_plugin_quote_address"


namespace Vendor\Package\Plugin;

class QuoteAdress
    protected $_forceNotSameAsBilling = null;

    public function aroundBeforeSave($subject, $proceed)
        if (!$subject->getId()) {
            $this->_forceNotSameAsBilling = true;

        $returnValue = $proceed();

        $this->_forceNotSameAsBilling = false;

        return $returnValue;

    public function aroundSetSameAsBilling($subject, $proceed, $sameAsBilling) {
        if ($this->_forceNotSameAsBilling) $sameAsBilling = 0;

        return $proceed($sameAsBilling);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.