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

Drawing without replacement: why is the order of draw irrelevant?

AppleTVs create a chatty alternate WiFi network

Effects on objects due to a brief relocation of massive amounts of mass

Why weren't discrete x86 CPUs ever used in game hardware?

Performance gap between vector<bool> and array

Is it possible for SQL statements to execute concurrently within a single session in SQL Server?

How fail-safe is nr as stop bytes?

How would a mousetrap for use in space work?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

Is it fair for a professor to grade us on the possession of past papers?

Do any jurisdictions seriously consider reclassifying social media websites as publishers?

Is grep documentation about ignoring case wrong, since it doesn't ignore case in filenames?

What is "gratricide"?

Most bit efficient text communication method?

How to tell that you are a giant?

If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?

Do wooden building fires get hotter than 600°C?

How does light 'choose' between wave and particle behaviour?

Why do we bend a book to keep it straight?

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

Hangman Game with C++

Disembodied hand growing fangs

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



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

            کانن (شرکت) محتویات تاریخچه[ویرایش] بخشی از تولیدات موفق این شرکت[ویرایش] در رده APS-C[ویرایش] گزارش محیط زیست[ویرایش] رده‌بندی محصولات[ویرایش] منابع[ویرایش] پانویس[ویرایش] پیوند به بیرون[ویرایش] منوی ناوبریwww.canon.comموزه آنلاین دوربین‌های کانننمودار تاریخچه سهام کاننوبگاه رسمی شرکت کاننوووووIDC Worldwide Hardcopy 2013

            Rest API with Magento using PHP with example. Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to update product using magento client library for PHP?Oauth Error while extending Magento Rest APINot showing my custom api in wsdl(url) and web service list?Using Magento API(REST) via IXMLHTTPRequest COM ObjectHow to login in Magento website using REST APIREST api call for Guest userMagento API calling using HTML and javascriptUse API rest media management by storeView code (admin)Magento REST API Example ErrorsHow to log all rest api calls in magento2?How to update product using magento client library for PHP?

            Magento 2 - Auto login with specific URL 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?Customer can't login - Page refreshes but nothing happensCustom Login page redirectURL to login with redirect URL after completionCustomer login is case sensitiveLogin with phone number or email address - Magento 1.9Magento 2: Set Customer Account Confirmation StatusCustomer auto connect from URLHow to call customer login form in the custom module action magento 2?Change of customer login error message magento2Referrer URL in modal login form