0

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

0

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

|improve this answer|||||
  • 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 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 at 11:17

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.