noesac Posted March 22, 2010 Share Posted March 22, 2010 I deleted a number of test orders from my back end however I noticed that they were still appearing in my newsletter CVS export and some other places.So I think the only way to completely delete them is via the DB. I found customer data in four main tables: 1) Customer2) Address3) Order4) Order detail(I take it cart data doesn't really matter)Now...I don't want to accidentally delete anything important so I have two questions: 1) Can I simply delete customers directly from the DB? Or will this have far reaching implications (e.g. when it tries to increment the next customer ID it will throw an error)?2) Can I get away with deleting records only from the Customer table, and forget the other three? I'm just not very confident about messing with those other tables without making a mistake. Link to comment Share on other sites More sharing options...
cream Posted March 23, 2010 Share Posted March 23, 2010 You can delete the customers directly in the back office.For deleting the orders in the back office, check this thread:http://www.prestashop.com/forums/viewthread/16427/ Link to comment Share on other sites More sharing options...
noesac Posted March 24, 2010 Author Share Posted March 24, 2010 cream, I have done this already. I'm asking for something different. Link to comment Share on other sites More sharing options...
smrdawg Posted April 21, 2010 Share Posted April 21, 2010 I'm having the same issue I believe. Yes in the back office it appears that you can delete a customer. And in that particular table your customer is deleted. However if you go to put a customer with the same email address it will not let you. So the customer still resides in the database under the database ps_customer. From what I can tell there doesn't seem to be any affect in deleting the row in that database after the fact.It seems that the code to delete the customer isn't touching all of the databases it needs to. The if statement that is controlling the delete button on that particular page is nested and appears to be generic, i.e. for deleting a number of entities from the backend. Does there need to be a further if statement to specify if it's a customer entity to also delete from the ps_customer table? The exact code that is needed I'm not sure, just think I'm on the right track... Link to comment Share on other sites More sharing options...
smrdawg Posted April 21, 2010 Share Posted April 21, 2010 Actually I believe I found a way to actually delete the customer from the backend. change $this->table = 'customer'; $this->className = 'Customer'; $this->lang = false; $this->edit = true; $this->view = true; $this->delete = true; $this->deleted = true;to $this->table = 'customer'; $this->className = 'Customer'; $this->lang = false; $this->edit = true; $this->view = true; $this->delete = true; //$this->deleted = true;Or in other words remove the $this->deleted = true; statement. Just want to verify will this cause other issues along the way? Link to comment Share on other sites More sharing options...
noesac Posted April 21, 2010 Author Share Posted April 21, 2010 Would be very interested if one of the regulars here could code review smrdawg's changes Link to comment Share on other sites More sharing options...
smrdawg Posted April 23, 2010 Share Posted April 23, 2010 I should add what file I changed that in, sorry. tabs/AdminCustomers.phpIt was commenting out or removing line 26.//$this->deleted = true;THanks Link to comment Share on other sites More sharing options...
archproject Posted April 30, 2010 Share Posted April 30, 2010 ok I can confirm that what smrdawg has given works but what about the other occurance in orders, order details and address? will there be any implication to the workingness of prestashop if we delete the rows from the database and not from BO? Some help here from the moderators please. RegardsArchproject Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now