I want to display the default billing autoselected in the dropdown menu https://prnt.sc/rmyqwo in checkout page Magento 2


Run this code in console i.e window.checkoutConfig.customerData.addresses you will see the list of address check which address is marked as default_billing: true use that key and add js code which will run once you click on next button after selecting shipping method or you can add in js once the checkout page load reference enter image description here

  • Thankyou john , i've run that code just now & saw address as default , what wil be the next step for me to prevent reloading this and billing section/address when i update/edit new billing address form ? – Hamendra Sunthwal Mar 31 '20 at 10:51
  • default billing address will be set by customer only from his/her account section once whatever they will select based on that address will become default you can use logic like if(window.checkoutConfig.customerData.addresses.length > 0) { window.checkoutConfig.customerData.addresses.forEach(function(ele,index){ if(ele.default_billing != undefined) { billing_inline = ele.inline; } }); – John Mar 31 '20 at 11:17
  • @HamendraSunthwal, did you get the solution for this? – Manjunath Mar 15 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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