Jump to content

delete all customers without orders


keat

Recommended Posts

I've not run the feature 'delete all customers without orders' for fear that it might delete customers who registered only yesterday, (or 10 minuts ago for that matter).

Is it possible to choose a date range and delete all customers without orders older than a given time.

I dare not click the button, to see what it does.

Link to comment
Share on other sites

What data does this feature remove.

I note that there are a few tables used for customer data.

I have an idea.

What if I were to run the following query in PHPMyAdmin             SELECT * FROM `CubeCart_customer` WHERE `order_count` = 0
Export the last 100 entries to a CSV file.
Run the GDPR tool, and let it do it's magic.
Import those 100 entries back in the cubecart_customer table.

 

would this work ?

 

 
Link to comment
Share on other sites

56 minutes ago, bsmither said:

I think a better solution to your situation is to modify the query sent to the database server by CubeCart to also include a timestamp that is less than a certain value (now minus x days).

Definitely a much better solution - Keat's solution would probably leave orphaned records in other tables for example the address table.  This solution really needs to be added to core for exactly the reasons outlined by Keat on Tuesday !

Link to comment
Share on other sites

The orphaned data was my thinking but in the opposite direction to you.

My reasoning, if I exported and removed 100 customers from the customer table, when I run the built in script, there would be potential orphaned address in the address table.

But when I import the 100 back in, the addresses would no longer be orphaned.

Thoughts. .?

Link to comment
Share on other sites

The tables affected by CubeCart's gathering up of customers to be deleted are:

CubeCart_customer, CubeCart_addressbook, CubeCart_customer_membership, CubeCart_newsletter_subscriber, and a hook to affect additional tables if necessary.

There are some tables that will have orphaned records - containing customer_id of now non-existent customers - but probably irrelevant to GDPR requirements.
 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...