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

The code below, is it ill-formed NDR or is it well formed?

How often does castling occur in grandmaster games?

Why do we bend a book to keep it straight?

Trademark violation for app?

How to write this math term? with cases it isn't working

Do wooden building fires get hotter than 600°C?

Illegal assignment from sObject to Id

What does it mean that physics no longer uses mechanical models to describe phenomena?

What's the meaning of "fortified infraction restraint"?

How does the math work when buying airline miles?

How do living politicians protect their readily obtainable signatures from misuse?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

How much damage would a cupful of neutron star matter do to the Earth?

Why is the AVR GCC compiler using a full `CALL` even though I have set the `-mshort-calls` flag?

AppleTVs create a chatty alternate WiFi network

Can a new player join a group only when a new campaign starts?

How to tell that you are a giant?

Is there a kind of relay only consumes power when switching?

How to compare two different files line by line in unix?

Most bit efficient text communication method?

Can anything be seen from the center of the Boötes void? How dark would it be?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

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

How to install press fit bottom bracket into new frame



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 13 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 13 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 13 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 13 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

            Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

            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

            How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2