magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Error in checkout - Billing address not updated when shipping address changed

Open lilmuckers opened this issue 10 years ago • 12 comments

Symptom

  • Customer enters checkout,
  • enters address,
  • goes to payment step,
  • chooses payment, sets "use same address as billing"
  • payment fails due to invalid field or some address validation issue on payment side
  • Customer clicks on the previous step to correct shipping address
  • when customer clicks through and maintains "same address for billing" same error presents

Upon investigation it was found that the billing address within the quote_address table still has the originally entered address value with the problem data.

lilmuckers avatar Feb 11 '16 15:02 lilmuckers

@lilmuckers Thank you for reporting this issue. Could you please provide details on the Magento version you are using and Payment methods you tested?

ishakhsuvarov avatar Feb 23 '16 15:02 ishakhsuvarov

I am using 2.0.2 CE - and i tried it with Ebizmarts_SagePaySuite and with the standard checkmo

Edit with more detail

For the checkmo one - i put a test into the code to throw a validation exception within the class. I did this in a number of places after the billing address was saved to the quote (just to simulate a multitude of errors that might happen from validation to payment to whatever). And every time - it wasn't updating the billing address implicitly, only if i unchecked "same as shipping" and then modified the address directly.

lilmuckers avatar Feb 23 '16 16:02 lilmuckers

@lilmuckers We have tried, but could not reproduce the issue you described. Is it possible to achieve same result using any of the stock online payment methods?

ishakhsuvarov avatar Feb 25 '16 08:02 ishakhsuvarov

@lilmuckers Closing this ticket for now. Please reopen if the issue persists.

ishakhsuvarov avatar Mar 16 '16 15:03 ishakhsuvarov

Hello,

I can replicate this issue on 2.0.4 CE and using stock payment methods. Steps to reproduce:

  • put product in cart, proceed to checkout, enter shipping address, select shipping method, proceed to payment step: http://prnt.sc/axuakb
  • go back to shipping step, introduce some changes: http://prnt.sc/axuazx
  • go back to payment step (you may even change shipping method while at it)
  • observe that billing address is not updated: http://prnt.sc/axub7b
  • uncheck and check the checkbox and observe changes: http://prnt.sc/axubms

Hope this helps!

@lilmuckers I believe only you can reopen this ticket.

janiscaunecm avatar Apr 28 '16 10:04 janiscaunecm

I am experiencing the same issue on 2.0.4.

Is this going to fix anytime soon?

SM528 avatar Aug 18 '16 08:08 SM528

I have the same issue.

Here is the steps to produce the issue.

address_not_proper_after_reload_page

I have filled the shipping address details and goes to the payment block and now i have reloaded the page and address will not be proper filled.

Thanks

webdesk avatar Jan 02 '17 10:01 webdesk

@webdesk Guys, any solutions ?

dev-Dhaval avatar Oct 12 '17 11:10 dev-Dhaval

@magento-engcom-team Any update on this?

miqbal699 avatar Nov 14 '17 12:11 miqbal699

any updates ? Issue still exists with the latest magento2 version..

wwwebgainss avatar Oct 22 '18 12:10 wwwebgainss

You could fix this with a mixin that overrides the setShippingInformation function in file Magento_Checkout/web/js/view/shipping.js. Code:

define([
    'jquery',
    'underscore',
    'Magento_Ui/js/form/form',
    'ko',
    'Magento_Customer/js/model/customer',
    'Magento_Customer/js/model/address-list',
    'Magento_Checkout/js/model/address-converter',
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/action/create-shipping-address',
    'Magento_Checkout/js/action/select-shipping-address',
    'Magento_Checkout/js/model/shipping-rates-validator',
    'Magento_Checkout/js/model/shipping-address/form-popup-state',
    'Magento_Checkout/js/model/shipping-service',
    'Magento_Checkout/js/action/select-shipping-method',
    'Magento_Checkout/js/model/shipping-rate-registry',
    'Magento_Checkout/js/action/set-shipping-information',
    'Magento_Checkout/js/model/step-navigator',
    'Magento_Ui/js/modal/modal',
    'Magento_Checkout/js/model/checkout-data-resolver',
    'Magento_Checkout/js/checkout-data',
    'uiRegistry',
    'mage/translate',
    'Magento_Checkout/js/action/select-billing-address',
    'Magento_Checkout/js/model/shipping-rate-service'
], function (
    $,
    _,
    Component,
    ko,
    customer,
    addressList,
    addressConverter,
    quote,
    createShippingAddress,
    selectShippingAddress,
    shippingRatesValidator,
    formPopUpState,
    shippingService,
    selectShippingMethodAction,
    rateRegistry,
    setShippingInformationAction,
    stepNavigator,
    modal,
    checkoutDataResolver,
    checkoutData,
    registry,
    $t,
    selectBillingAddress
) {
    'use strict';

    return function (OriginalComponent) {
        return OriginalComponent.extend({
            setShippingInformation: function () {
                if (this.validateShippingInformation()) {
                   selectBillingAddress(quote.shippingAddress());

                    setShippingInformationAction().done(
                        function () {
                            stepNavigator.next();
                        }
                    );
                }
            }
        });
    }
});

Hope this helps anyone who needs a quick fix. (@lilmuckers, @webdesk )

wendydek avatar Nov 05 '18 08:11 wendydek

You could fix this with a mixin that overrides the setShippingInformation function in file Magento_Checkout/web/js/view/shipping.js. Code:

define([
    'jquery',
    'underscore',
    'Magento_Ui/js/form/form',
    'ko',
    'Magento_Customer/js/model/customer',
    'Magento_Customer/js/model/address-list',
    'Magento_Checkout/js/model/address-converter',
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/action/create-shipping-address',
    'Magento_Checkout/js/action/select-shipping-address',
    'Magento_Checkout/js/model/shipping-rates-validator',
    'Magento_Checkout/js/model/shipping-address/form-popup-state',
    'Magento_Checkout/js/model/shipping-service',
    'Magento_Checkout/js/action/select-shipping-method',
    'Magento_Checkout/js/model/shipping-rate-registry',
    'Magento_Checkout/js/action/set-shipping-information',
    'Magento_Checkout/js/model/step-navigator',
    'Magento_Ui/js/modal/modal',
    'Magento_Checkout/js/model/checkout-data-resolver',
    'Magento_Checkout/js/checkout-data',
    'uiRegistry',
    'mage/translate',
    'Magento_Checkout/js/action/select-billing-address',
    'Magento_Checkout/js/model/shipping-rate-service'
], function (
    $,
    _,
    Component,
    ko,
    customer,
    addressList,
    addressConverter,
    quote,
    createShippingAddress,
    selectShippingAddress,
    shippingRatesValidator,
    formPopUpState,
    shippingService,
    selectShippingMethodAction,
    rateRegistry,
    setShippingInformationAction,
    stepNavigator,
    modal,
    checkoutDataResolver,
    checkoutData,
    registry,
    $t,
    selectBillingAddress
) {
    'use strict';

    return function (OriginalComponent) {
        return OriginalComponent.extend({
            setShippingInformation: function () {
                if (this.validateShippingInformation()) {
                   selectBillingAddress(quote.shippingAddress());

                    setShippingInformationAction().done(
                        function () {
                            stepNavigator.next();
                        }
                    );
                }
            }
        });
    }
});

Hope this helps anyone who needs a quick fix. (@lilmuckers, @webdesk )

this is not working for me. anyone got a solution ?

wwwebgainss avatar Feb 13 '19 11:02 wwwebgainss