Magento 2 : Default billing address not selected by default on checkout page Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?M2.2.4 Checkout: Adding New Shipping Address automatically sets address as Billing AddressHow to restrict onepage checkout to not load address same as billing when select “Ship to different address” on frontend?How to check billing and shipping address are sameMove billing address form to shipping address page in magento 2.1Move “My billing and shipping address are the same” to shipping sectionMagento 2 : Remove Billing Address From Payment Step in CheckoutChange default behaviour for address selection in checkoutMagento2 remove some addresses on checkout page when selecting shipping addressMagento 2 Setting a address as DefaultM2.2.4 Checkout: Adding New Shipping Address automatically sets address as Billing AddressMagento 2 how to dispaly billing address in opc-sidebar in checkout page

Should I use a zero-interest credit card for a large one-time purchase?

How to write the following sign?

How would a mousetrap for use in space work?

SF book about people trapped in a series of worlds they imagine

Why do we need to use the builder design pattern when we can do the same thing with setters?

Is a ledger board required if the side of my house is wood?

Disembodied hand growing fangs

How come Sam didn't become Lord of Horn Hill?

Did Krishna say in Bhagavad Gita "I am in every living being"

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

As a beginner, should I get a Squier Strat with a SSS config or a HSS?

What is "gratricide"?

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

How to tell that you are a giant?

Significance of Cersei's obsession with elephants?

Why wasn't DOSKEY integrated with COMMAND.COM?

Do wooden building fires get hotter than 600°C?

Generate an RGB colour grid

Why aren't air breathing engines used as small first stages?

How could we fake a moon landing now?

Dating a Former Employee

Is there hard evidence that the grant peer review system performs significantly better than random?

Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?

What initially awakened the Balrog?



Magento 2 : Default billing address not selected by default on checkout page



Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?M2.2.4 Checkout: Adding New Shipping Address automatically sets address as Billing AddressHow to restrict onepage checkout to not load address same as billing when select “Ship to different address” on frontend?How to check billing and shipping address are sameMove billing address form to shipping address page in magento 2.1Move “My billing and shipping address are the same” to shipping sectionMagento 2 : Remove Billing Address From Payment Step in CheckoutChange default behaviour for address selection in checkoutMagento2 remove some addresses on checkout page when selecting shipping addressMagento 2 Setting a address as DefaultM2.2.4 Checkout: Adding New Shipping Address automatically sets address as Billing AddressMagento 2 how to dispaly billing address in opc-sidebar in checkout page



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am using Magento 2.0.7 and my default billing and shipping address are different in My account Address section.



When I am going on checkout page my default shipping address selected by default and I move on payment section but on payment section My shipping address by default set as billing address.




I already mention default billing address then how we get that address selected by default ?











share|improve this question
















bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Hi did you get a solution for this?

    – Geethika Antony
    Mar 16 '17 at 4:54











  • Hi Ashish, I face some different kind of problem but If you can write the solution of this than it's may be its help full.

    – jaydip sinh Parmar
    Sep 12 '17 at 6:55

















1















I am using Magento 2.0.7 and my default billing and shipping address are different in My account Address section.



When I am going on checkout page my default shipping address selected by default and I move on payment section but on payment section My shipping address by default set as billing address.




I already mention default billing address then how we get that address selected by default ?











share|improve this question
















bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Hi did you get a solution for this?

    – Geethika Antony
    Mar 16 '17 at 4:54











  • Hi Ashish, I face some different kind of problem but If you can write the solution of this than it's may be its help full.

    – jaydip sinh Parmar
    Sep 12 '17 at 6:55













1












1








1








I am using Magento 2.0.7 and my default billing and shipping address are different in My account Address section.



When I am going on checkout page my default shipping address selected by default and I move on payment section but on payment section My shipping address by default set as billing address.




I already mention default billing address then how we get that address selected by default ?











share|improve this question
















I am using Magento 2.0.7 and my default billing and shipping address are different in My account Address section.



When I am going on checkout page my default shipping address selected by default and I move on payment section but on payment section My shipping address by default set as billing address.




I already mention default billing address then how we get that address selected by default ?








magento2 checkout shipping-address billing-address






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 9 '17 at 7:25







Ashish Jagnani

















asked Oct 4 '16 at 4:52









Ashish JagnaniAshish Jagnani

4,59721956




4,59721956





bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Hi did you get a solution for this?

    – Geethika Antony
    Mar 16 '17 at 4:54











  • Hi Ashish, I face some different kind of problem but If you can write the solution of this than it's may be its help full.

    – jaydip sinh Parmar
    Sep 12 '17 at 6:55

















  • Hi did you get a solution for this?

    – Geethika Antony
    Mar 16 '17 at 4:54











  • Hi Ashish, I face some different kind of problem but If you can write the solution of this than it's may be its help full.

    – jaydip sinh Parmar
    Sep 12 '17 at 6:55
















Hi did you get a solution for this?

– Geethika Antony
Mar 16 '17 at 4:54





Hi did you get a solution for this?

– Geethika Antony
Mar 16 '17 at 4:54













Hi Ashish, I face some different kind of problem but If you can write the solution of this than it's may be its help full.

– jaydip sinh Parmar
Sep 12 '17 at 6:55





Hi Ashish, I face some different kind of problem but If you can write the solution of this than it's may be its help full.

– jaydip sinh Parmar
Sep 12 '17 at 6:55










2 Answers
2






active

oldest

votes


















0














You could do the following:



  • overwrite a default js file checkout-data-resolver.js

  • add extra lines to the applyBillingAddress function to check if default
    billing address exists and if true to use it

step 1. Overwritting a default magento checkout-data-resolver.js



  • 1.1 Create your module. YourCompanyCheckout


  • 1.2 Add file appcodeYourCompanyCheckoutviewfrontendrequirejs-config.js


with following content



var config = 
map:
'*':
'Magento_Checkout/js/model/checkout-data-resolver':
'YourCompany_Checkout/js/model/checkout-data-resolver'



;


  • 1.3 Copy magento file vendormagentomodule-checkoutviewfrontendwebjsmodelcheckout-data-resolver.js
    to the destination
    appcodeYourCompanyCheckoutviewfrontendwebjsmodelcheckout-data-resolver.js

step 2. Modify applyBillingAddress function



2.1 in new checkout-data-resolver.js file find applyBillingAddress. Insert following cod after var shippingAddress; and before if (quote.billingAddress())



....
var isBillingAddressInitialized;
isBillingAddressInitialized = addressList.some(function (addressFromList)
if (addressFromList.isDefaultBilling())
selectBillingAddress(addressFromList);
return true;


return false;
);

if(isBillingAddressInitialized)
return;

....


This code actually goes through customer addresses and checks if any of them has defaultBilling set to true. If such an address exists it will be used as the billing address. If not the script will fall back to the default magento behavior






share|improve this answer























  • I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

    – ne0nlight
    Oct 10 '18 at 19:40


















0














I got solution of this problem.
please check your theme override file:




/app/design/frontend/Vendor/your-theme/Magento_Checkout/web/js/view/shipping.js




in this file checkout your custom code on line no 114 or may be change of this line your file. So, checkout this function



initialize: function ()


Inside this function check following code



 registry.async('checkoutProvider')(function (checkoutProvider) 
//////////
Your Code
/////////
);


from this jQuery remove your custom code or update with new code.



hope it will work for you. In my case it is working for me after update this function.



Thanks






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f139195%2fmagento-2-default-billing-address-not-selected-by-default-on-checkout-page%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You could do the following:



    • overwrite a default js file checkout-data-resolver.js

    • add extra lines to the applyBillingAddress function to check if default
      billing address exists and if true to use it

    step 1. Overwritting a default magento checkout-data-resolver.js



    • 1.1 Create your module. YourCompanyCheckout


    • 1.2 Add file appcodeYourCompanyCheckoutviewfrontendrequirejs-config.js


    with following content



    var config = 
    map:
    '*':
    'Magento_Checkout/js/model/checkout-data-resolver':
    'YourCompany_Checkout/js/model/checkout-data-resolver'



    ;


    • 1.3 Copy magento file vendormagentomodule-checkoutviewfrontendwebjsmodelcheckout-data-resolver.js
      to the destination
      appcodeYourCompanyCheckoutviewfrontendwebjsmodelcheckout-data-resolver.js

    step 2. Modify applyBillingAddress function



    2.1 in new checkout-data-resolver.js file find applyBillingAddress. Insert following cod after var shippingAddress; and before if (quote.billingAddress())



    ....
    var isBillingAddressInitialized;
    isBillingAddressInitialized = addressList.some(function (addressFromList)
    if (addressFromList.isDefaultBilling())
    selectBillingAddress(addressFromList);
    return true;


    return false;
    );

    if(isBillingAddressInitialized)
    return;

    ....


    This code actually goes through customer addresses and checks if any of them has defaultBilling set to true. If such an address exists it will be used as the billing address. If not the script will fall back to the default magento behavior






    share|improve this answer























    • I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

      – ne0nlight
      Oct 10 '18 at 19:40















    0














    You could do the following:



    • overwrite a default js file checkout-data-resolver.js

    • add extra lines to the applyBillingAddress function to check if default
      billing address exists and if true to use it

    step 1. Overwritting a default magento checkout-data-resolver.js



    • 1.1 Create your module. YourCompanyCheckout


    • 1.2 Add file appcodeYourCompanyCheckoutviewfrontendrequirejs-config.js


    with following content



    var config = 
    map:
    '*':
    'Magento_Checkout/js/model/checkout-data-resolver':
    'YourCompany_Checkout/js/model/checkout-data-resolver'



    ;


    • 1.3 Copy magento file vendormagentomodule-checkoutviewfrontendwebjsmodelcheckout-data-resolver.js
      to the destination
      appcodeYourCompanyCheckoutviewfrontendwebjsmodelcheckout-data-resolver.js

    step 2. Modify applyBillingAddress function



    2.1 in new checkout-data-resolver.js file find applyBillingAddress. Insert following cod after var shippingAddress; and before if (quote.billingAddress())



    ....
    var isBillingAddressInitialized;
    isBillingAddressInitialized = addressList.some(function (addressFromList)
    if (addressFromList.isDefaultBilling())
    selectBillingAddress(addressFromList);
    return true;


    return false;
    );

    if(isBillingAddressInitialized)
    return;

    ....


    This code actually goes through customer addresses and checks if any of them has defaultBilling set to true. If such an address exists it will be used as the billing address. If not the script will fall back to the default magento behavior






    share|improve this answer























    • I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

      – ne0nlight
      Oct 10 '18 at 19:40













    0












    0








    0







    You could do the following:



    • overwrite a default js file checkout-data-resolver.js

    • add extra lines to the applyBillingAddress function to check if default
      billing address exists and if true to use it

    step 1. Overwritting a default magento checkout-data-resolver.js



    • 1.1 Create your module. YourCompanyCheckout


    • 1.2 Add file appcodeYourCompanyCheckoutviewfrontendrequirejs-config.js


    with following content



    var config = 
    map:
    '*':
    'Magento_Checkout/js/model/checkout-data-resolver':
    'YourCompany_Checkout/js/model/checkout-data-resolver'



    ;


    • 1.3 Copy magento file vendormagentomodule-checkoutviewfrontendwebjsmodelcheckout-data-resolver.js
      to the destination
      appcodeYourCompanyCheckoutviewfrontendwebjsmodelcheckout-data-resolver.js

    step 2. Modify applyBillingAddress function



    2.1 in new checkout-data-resolver.js file find applyBillingAddress. Insert following cod after var shippingAddress; and before if (quote.billingAddress())



    ....
    var isBillingAddressInitialized;
    isBillingAddressInitialized = addressList.some(function (addressFromList)
    if (addressFromList.isDefaultBilling())
    selectBillingAddress(addressFromList);
    return true;


    return false;
    );

    if(isBillingAddressInitialized)
    return;

    ....


    This code actually goes through customer addresses and checks if any of them has defaultBilling set to true. If such an address exists it will be used as the billing address. If not the script will fall back to the default magento behavior






    share|improve this answer













    You could do the following:



    • overwrite a default js file checkout-data-resolver.js

    • add extra lines to the applyBillingAddress function to check if default
      billing address exists and if true to use it

    step 1. Overwritting a default magento checkout-data-resolver.js



    • 1.1 Create your module. YourCompanyCheckout


    • 1.2 Add file appcodeYourCompanyCheckoutviewfrontendrequirejs-config.js


    with following content



    var config = 
    map:
    '*':
    'Magento_Checkout/js/model/checkout-data-resolver':
    'YourCompany_Checkout/js/model/checkout-data-resolver'



    ;


    • 1.3 Copy magento file vendormagentomodule-checkoutviewfrontendwebjsmodelcheckout-data-resolver.js
      to the destination
      appcodeYourCompanyCheckoutviewfrontendwebjsmodelcheckout-data-resolver.js

    step 2. Modify applyBillingAddress function



    2.1 in new checkout-data-resolver.js file find applyBillingAddress. Insert following cod after var shippingAddress; and before if (quote.billingAddress())



    ....
    var isBillingAddressInitialized;
    isBillingAddressInitialized = addressList.some(function (addressFromList)
    if (addressFromList.isDefaultBilling())
    selectBillingAddress(addressFromList);
    return true;


    return false;
    );

    if(isBillingAddressInitialized)
    return;

    ....


    This code actually goes through customer addresses and checks if any of them has defaultBilling set to true. If such an address exists it will be used as the billing address. If not the script will fall back to the default magento behavior







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Sep 27 '18 at 8:05









    Михаил КрыловМихаил Крылов

    11




    11












    • I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

      – ne0nlight
      Oct 10 '18 at 19:40

















    • I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

      – ne0nlight
      Oct 10 '18 at 19:40
















    I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

    – ne0nlight
    Oct 10 '18 at 19:40





    I'm running into a similar issue, but only when I add a new address in the shipping step prior to going to the payment step, it ends up taking the new shipping address and automatically changing the default billing address to the new shipping address. Any idea what could cause that? I tried this fix, however the issue persists.

    – ne0nlight
    Oct 10 '18 at 19:40













    0














    I got solution of this problem.
    please check your theme override file:




    /app/design/frontend/Vendor/your-theme/Magento_Checkout/web/js/view/shipping.js




    in this file checkout your custom code on line no 114 or may be change of this line your file. So, checkout this function



    initialize: function ()


    Inside this function check following code



     registry.async('checkoutProvider')(function (checkoutProvider) 
    //////////
    Your Code
    /////////
    );


    from this jQuery remove your custom code or update with new code.



    hope it will work for you. In my case it is working for me after update this function.



    Thanks






    share|improve this answer



























      0














      I got solution of this problem.
      please check your theme override file:




      /app/design/frontend/Vendor/your-theme/Magento_Checkout/web/js/view/shipping.js




      in this file checkout your custom code on line no 114 or may be change of this line your file. So, checkout this function



      initialize: function ()


      Inside this function check following code



       registry.async('checkoutProvider')(function (checkoutProvider) 
      //////////
      Your Code
      /////////
      );


      from this jQuery remove your custom code or update with new code.



      hope it will work for you. In my case it is working for me after update this function.



      Thanks






      share|improve this answer

























        0












        0








        0







        I got solution of this problem.
        please check your theme override file:




        /app/design/frontend/Vendor/your-theme/Magento_Checkout/web/js/view/shipping.js




        in this file checkout your custom code on line no 114 or may be change of this line your file. So, checkout this function



        initialize: function ()


        Inside this function check following code



         registry.async('checkoutProvider')(function (checkoutProvider) 
        //////////
        Your Code
        /////////
        );


        from this jQuery remove your custom code or update with new code.



        hope it will work for you. In my case it is working for me after update this function.



        Thanks






        share|improve this answer













        I got solution of this problem.
        please check your theme override file:




        /app/design/frontend/Vendor/your-theme/Magento_Checkout/web/js/view/shipping.js




        in this file checkout your custom code on line no 114 or may be change of this line your file. So, checkout this function



        initialize: function ()


        Inside this function check following code



         registry.async('checkoutProvider')(function (checkoutProvider) 
        //////////
        Your Code
        /////////
        );


        from this jQuery remove your custom code or update with new code.



        hope it will work for you. In my case it is working for me after update this function.



        Thanks







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '18 at 10:15









        SarfarajSarfaraj

        405518




        405518



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f139195%2fmagento-2-default-billing-address-not-selected-by-default-on-checkout-page%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

            Aasi (pallopeli) Navigointivalikko