To avoid overload my customer table I'm erasing all customers without orders:
DELETE `oc_customer` FROM `oc_customer` LEFT JOIN `oc_order` ON oc_customer.customer_id = oc_order.customer_id WHERE oc_order.customer_id Is Null;
Original post: viewtopic.php?t=88877&sid=684508f44cfc6 ... 5ffb4de781
Also blocking access from other countries through htaccess.
# Put countries to allow here
SetEnvIf GEOIP_COUNTRY_CODE AU AllowCountry
SetEnvIf GEOIP_COUNTRY_CODE NZ AllowCountry
Deny from all
Allow from env=AllowCountry
Aditionally you can edit admin/sale/customer.php and add these lines to the public function deleteCustomer($customer_id) so the query will run just by selecting any customer and clicking "Delete":
Code: Select all
// DELETE CUSTOMERS WITHOUT ORDERS SELECTING ONE OF THEM
$this->db->query("DELETE " . DB_PREFIX . "customer FROM " . DB_PREFIX . "customer LEFT JOIN " . DB_PREFIX . "order ON " . DB_PREFIX . "customer.customer_id = " . DB_PREFIX . "order.customer_id WHERE " . DB_PREFIX . "order.customer_id Is Null");