Pergunta

I'm working on the OneStepCheckout and my problem is when I clicked on the place order button and the My billing and shipping address are the same checkbox is not changed (after filling the shipping address) then it gives me error for required billing address fields.

I'm trying to update/reload the billing address (if the My billing and shipping address are the same checkbox is clicked) when all the fields are filled in the shipping address form on the checkout page.

Can anyone help me with this.

Thanks in advance!!!

Foi útil?

Solução

Thank you all for this great support of yours. I'm able to fix this on my OWN.

define([
    'ko',
    'jquery',
    'Magento_Checkout/js/model/quote'
], function (ko, $, quote) {
    'use strict';

    /**
     * Update Billing Address
     */
    function updateBillingAddress(element) {
        if (quote.shippingAddress() && quote.billingAddress() && $("input[name='billing-address-same-as-shipping']:checked").val() !== undefined) {
            quote.billingAddress(quote.shippingAddress()); //this will set the billing address same as shipping address.
        }
    }

});

Hope it'll help someone having same issue :)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top