Jump to content

Order Address becomes random address of other users.


Recommended Posts

So we've been having this issue for years now throughout multiple versions. In something like 1 out of 100 orders, the customer address of an order gets replaced by some other user's address. This has been happening over 2 different payment modules so it's not isolated to a specific module.

 

I can't replicate it over and over again. But since we're having ~80,000 orders. That's a lot of orders with wrong addresses even if it only happens occasionally...

 

So what happens is the following...

 

A customer places an order using address "John Doe, King Street 1, London" and in the backend the address of the order becomes "Jimmy Johnsson, Queens Street, Manchester" (A address already in the database, belonging to a completely other customer who placed an order 5 years ago).

 

See screenshot attached or link below:

http://imgur.com/MxwZ32R (Blurred out some private information about the customer, but you can see the addresses are completely different).

Also as you can see here (http://imgur.com/EfZLhGR) the address that is set to the order, does not even exist in the list of addresses belonging to the customer.

 

You can also see that the REAL address that was entered during checkout is saved and placed in the list of customer addresses. But the "active" address of the order is an address that has nothing to do with the current customer to do at all.

Usually it is the same 2-3 address that keep coming back, all of them belonging to users from way back in time.

 

We've been trying everything to figure this error out... Including looking through line-by-line of the payment modules to see if there is some hardcoded address ID in there somewhere... There's not.

 

For anyone interested in one of the payment modules code, that handles the checkout and payment and saving of the addresses. You can see it here: http://paste.ofcode.org/T889rkuq6KEMu6EV4rfrAK

 

As you can see. It uses the posted data from Tools::getValue();, creates a new address and then adds the id of the address to $cart->id_address_delivery and $cart->id_address_invoice.

 

Perhaps there is some bug from updating Prestashop's database over and over again throughout the years of us using Prestashop and moving from version to version.

 

Anyone ran into the same bug/error before? Ideas for solution?

 

 

EDIT:

 

After additional testing I found out something new. When I check $cart->id_address_invoice and $this->context->cart->id_address_invoice, they are different. For some reason, sometimes the $this->context->cart->id_address_invoice is set to a address that is very far back in time. In my case there are 100,000 addresses in the database that differs the context->cart->id_address_invoice from the cart->id_address_invoice.

 

Now I tried to update the context cart by doing "$this->context->cart->id_address_invoice = $cart->id_address_invoice". It did not work though.

Any ideas of how I should update the context->cart->id_address_invoice/id_address_delivery ? 

post-70746-0-60406900-1444285022_thumb.jpg

post-70746-0-89610000-1444286573_thumb.jpg

Edited by xertion (see edit history)
Link to comment
Share on other sites

  • 2 years later...
  • 11 months later...
  • 1 year later...
  • 1 year later...

Nope still same issue...
What version are you on? We still 1.6, I'm hoping the problem goes away when we go to 1.7 eventually...

 

I have a feeling it might have to do with one of the caches or maybe MySQL setup somehow. No idea how to test this however. Have tried turning caches off but doesnt help I dont think

Link to comment
Share on other sites

4 hours ago, Ramb0t said:

Nope still same issue...
What version are you on? We still 1.6, I'm hoping the problem goes away when we go to 1.7 eventually...

 

I have a feeling it might have to do with one of the caches or maybe MySQL setup somehow. No idea how to test this however. Have tried turning caches off but doesnt help I dont think

We are on 1.7.6.8, so unfortunately that's not the case :(

Have tried turning caches off aswell, nothing changed.

I've been replied in another post (about the same issue) pointing that it might have to do with messed up shopping cart ID's in database, which is solved in the next url:

We are thinking about trying this. Still not sure about it tho.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...