Why on checkout page shipping and billing address are reset after page refresh?

The question:

We have the following situation in Magento:

  1. Guest customer is about place order.
  2. The customer filled his billing and shipping addresses on checkout page.
  3. The customer reached one of the following checkout steps (shipping methods, payment methods, order review).
  4. The customer decides to edit his cart and goes back to cart page
  5. The customer reaches the checkout page again and he has to fill shipping and billing address.

My question is what is the non programming reason to always start with fresh addresses on checkout page even when a customer filled them already in current checkout session?

It looks that Magento Core Team intentionally wants this effect. But why? Is there an edge case that may cause problems for the customers?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

That is definitely a kind of a bug-feature that was done by core team on purpose, but I don’t think that it is done specifically for resetting an address. Might be it was a bug fix of filled in address fields on some blocks, before onepage template has been separated from multi shipping checkout.

But the main point is that address is actually is not reset. Problem lies in the block for address steps, as if customer is not logged it it uses empty new model as data source for address form. That’s simple as that. Just add observer on before_to_html for that block and set original quote address into the block and your issue is fixed.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment