CoderJim Posted March 24, 2019 Share Posted March 24, 2019 Like many others I have been deluged with bogus 'customers' created by bots and mechanical turks, I see a possible solution in a past post (2/3/16) by member avyona where they said they had used this code in their phpMyAdmin to clean the DB... "DELETE FROM `CubeCart_customer` WHERE order_count = 0 AND registered < 1460000000; or even better: DELETE FROM `CubeCart_customer` WHERE order_count = 0; It will clean house in a second!" Has anyone tried this with the current 6.2.2 CC Foundation and/or is this a risky move? Thanks Jim Link to comment Share on other sites More sharing options...
bsmither Posted March 24, 2019 Share Posted March 24, 2019 I have modded a CC6 store such that in the Customer List, there is a checkbox on each line and a "Do this for each selected..." drop-down selector. Depending how many bogus customers you wish to delete, that is to say, how long this has been happening and how much you have let accumulate, it could take you five to twenty minutes to clear them out. Plus, a simple edit to index.php will test for a few key aspects of these form submissions and then tell PHP to simply die. Link to comment Share on other sites More sharing options...
havenswift-hosting Posted March 24, 2019 Share Posted March 24, 2019 The second sql statement will delete all records in the customer table that have never placed an order. The first is a variation that deletes the same but only when they were registered before a specific time 1 hour ago, CoderJim said: is this a risky move? Implementing sql statements that delete records without knowing what they do would always be risky ! Link to comment Share on other sites More sharing options...
keat Posted March 25, 2019 Share Posted March 25, 2019 I went one step further on one of my sites. By exporting the customer and also the address table, I could identify which customers had never purchased then cross reference these to thier address entries. Delete both and import the tables back in. Using PHP my admin, you could narrow these down to anything, say prior to 12 months ago, and only delete the customers who registered and never purchased say prior to 2018. One thing I would suggest, is using PHPMyadmin, make a copy of the table and work on the copy. Link to comment Share on other sites More sharing options...
CoderJim Posted March 25, 2019 Author Share Posted March 25, 2019 Thanks for all the help, I will certainly be looking into this soon and report my conclusion. Note: I always save a copy before working on a file I did not create, good idea for anyone doing this type of work. Link to comment Share on other sites More sharing options...
CoderJim Posted April 4, 2019 Author Share Posted April 4, 2019 Okay, so in CC 6.2.4 with bsmither's help (I assume) and the provided solution, it worked beautifully and this command was not required. I will be using it regularly. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.