Jump to content

delete all customers without orders

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 post
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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...