1

By default I want to keep "My billing and shipping address are same" button un-checked and billing address form open on checkout page. For this I have copied billing-address.js file in my theme at app/design/frontend/Vendor/Theme/Magento_Checkout/web/js/view/billing-address.js and inside quote.billingAddress.subscribe I have added my code as given below

if (quote.isVirtual()) {
   this.isAddressSameAsShipping(false);
} 
/* my custom code starts*/
if(window.checkoutConfig.quoteData.delivery_type == 'store') {
    this.isAddressSameAsShipping(false);
    jQuery( ".action-edit-address" ).trigger( "click" );
}
/* my custom code ends*/

After adding above code, checkbox is un-checked but still form is not open. If I paster trigger code in browser's console form is getting opened ? How I can make the form also open?

Your Answer

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

Browse other questions tagged or ask your own question.