[MOD] Let customer delete the account
Posted: Tue Nov 09, 2010 3:55 am
Customer can delete the account with this modification.


1. EDIT: catalog/model/account/customer.php
Add this function into ModelAccountCustomer class.
catalog/language/english/account/account.php
catalog/view/theme/default/template/account/account.tpl
2. UPLOAD: extract attached archive into "catalog" directory.


1. EDIT: catalog/model/account/customer.php
Add this function into ModelAccountCustomer class.
Code: Select all
public function deleteCustomer($customer_id) {
$this->db->query("DELETE FROM " . DB_PREFIX . "customer WHERE customer_id = '" . (int)$customer_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "address WHERE customer_id = '" . (int)$customer_id . "'");
}
Code: Select all
$_['text_delete'] = 'Delete account';
Code: Select all
<li><a href="<?php echo str_replace('&', '&', $delete); ?>"><?php echo $text_delete; ?></a></li>