Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Managing Customers and Orders / Purging addresses for wholesale customers

Purging addresses for wholesale customers

Started by jbhansen on 30 Sep 2011, 5:03 PM · Views: 607

Results 1 to 1 of 1
30 Sep 2011, 5:03 PM
#1
jbhansen avatar

jbhansen

New Zenner

Join Date:
Dec 2006
Posts:
19
Plugin Contributions:
0

Post #1 by jbhansen

Without going into too much detail (I can if it's needed), I need to have a way to purge all addresses for a customer, with the exception of their default address.

The SQL that needs to be run is:
DELETE FROM address_book WHERE customers_id = {customer id} AND address_book_id <> {customers' default address book id}

But rather than run it through phpmyadmin, I would like to run it from the admin's customer.php page - either in the customer list, or on the customer details screen. A "Purge Addresses" button in either of those locations would be perfect.

Does anyone have any hints on how I would go about implementing this? We need to lookup the customer's default address id (customers.address_book_id) first, then run the SQL.

Thanks in advance!