Jump to content

address deleted but not deleted


Recommended Posts

Why is it Prestashop does not delete some addresses? Does this have to do with preserving address book entries for orders in the system? If so, is that the only reason?

 

The reason I am asking is I found a bug in the system. If someone deletes an address from their address book and it's being used in the cart it will delete the address but won't remove the reference of the address in the cart. I want to fix this but I'm unsure of where to put this. I was going to put it in the address delete function, which is as follows:

 

public function delete()
{
if (Validate::isUnsignedId($this->id_customer))
 Customer::resetAddressCache($this->id_customer);
if (!$this->isUsed())
 return parent::delete();
else
{
 $this->deleted = true;
 return $this->update();
}
}

 

I'm thinking I'll have to do it in both instances. If it's "isUsed" and not "isUsed".

 

Yes, I've created a bug tracker entry for this.

Link to comment
Share on other sites

Sorry but I do not see this as a bug, the program is preserving the address because it is in use just like trying to delete a file from your computer that is being used by a program.

Why would you delete an address that is needed for a pending order.

Link to comment
Share on other sites

  • 2 years later...

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...