0

So I have 3 shipping methods on my checkout page,

Shipping Method

Free Ground Shipping- $0
2-Day Shipping - $15
Overnight - $35

By default, the first one Free Ground Shipping- $0 is always selected, but if I select either 2-Day Shipping/Overnight as the shipping method, I get the issue of Billing address same as shipping, as Billing Address is not set as Shipping address. but the checkbox is selected somehow I don't know-how.

These are the error I get

enter image description here

enter image description here

I know this has something to do with app/code/MODULE/Checkout/view/frontend/web/js/model/checkout-data-resolver.js

 applyBillingAddress: function () {
        var shippingAddress;

        if (quote.billingAddress() && quote.billingAddress().hasOwnProperty('telephone')) {
            selectBillingAddress(quote.billingAddress());

            return;
        }
        shippingAddress = quote.shippingAddress();

        if (shippingAddress &&
            shippingAddress.canUseForBilling() &&
            (shippingAddress.isDefaultShipping() || !quote.isVirtual())
        ) {
            //set billing address same as shipping by default if it is not empty
            selectBillingAddress(quote.shippingAddress());
        }
    }

How to fix this.

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.