Post by martynas.barzda » Tue Nov 09, 2010 3:55 am

Customer can delete the account with this modification.
Image
Image

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 . "'");
	}
catalog/language/english/account/account.php

Code: Select all

$_['text_delete']        = 'Delete account';
catalog/view/theme/default/template/account/account.tpl

Code: Select all

<li><a href="<?php echo str_replace('&', '&', $delete); ?>"><?php echo $text_delete; ?></a></li>
2. UPLOAD: extract attached archive into "catalog" directory.

Attachments

extract into "catalog" directory



Posts

Joined
Tue Nov 09, 2010 3:06 am
Location - Kaunas, Lithuania

Post by cricri92 » Mon Nov 15, 2010 11:37 pm

I installed your module but I get an error when I click on "delete account" in the browser

Code: Select all

You don't have permission to acces /opencart/<b>Notice</b>Undefined variable: delete in
<b>C:/wamp/www/opencart/boutique/catalog/view/theme/default/template/account/account.tpl</b> on line <b>19</b> on this server.
thank you

Newbie

Posts

Joined
Wed Aug 11, 2010 12:48 pm

Post by SapporoGuy » Tue Nov 16, 2010 2:02 am

What is on line 19 (17-20) in the account.tpl ?

Also, possibly you might have to add:

Code: Select all

$this->data['text_delete'] = $this->language->get('text_delete');
to the controller/account file

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by Gilmore » Tue Nov 16, 2010 2:53 am

While I do appreciate your making an Extension and I can understand you think the Customer needs this option, they actually don't. You can't go to Sears and delete your account. They do this for a reason. Down the road you have a problem with the very same Customer, you have no records to back up your side of anything. Actually it's pretty unheard of to allow Customers to delete their account. This is not a Forum or Bulletin Board. I would not let a Customer delete their records in my business once I have done business with them. Businesses just don't let the Customers delete their accounts on their own for a reason. What if someone steals this persons login and deletes them while they are waiting on an order? Then they contact you and ask the status of their order? You look it up and can't find a thing because someone deleted their account. What are you going to do then?

And what if they Delete their account after running up a huge order and you ship it only to find out a few days later they were all about the fraud of ripping you off? Now you go to look them up and NO RECORDS!!!! Well so much for having their IP to help the Authorities out! See my point?

DO NOT LET PEOPLE DELETE YOUR CUSTOMER ACCOUNTS!!!
Their records are you proof of what they do. Erase that and it is ALL on you! And try to get a Court to side with you when you are getting sued for not being able to prove they did that form your web site!

I hope next you don't think letting the Customers alter their order once it has been placed will be a good idea too! lol

JMO!

Gilmore

User avatar
Active Member

Posts

Joined
Thu Aug 12, 2010 7:33 am

Post by Xsecrets » Tue Nov 16, 2010 4:12 am

while I don't really see the need for this mod either it would not delete all your records the orders would still be there along with the ip information associated. All that would get deleted is the customer record which is pretty much just their address book, which you will have that information in the order anyways. Like I said I don't really see the need for this mod, but I don't see it being as bad as you are making it out to be. The worst case scenario is like you said someone gets a customers details and deletes their account, however the order would still be there and get processed. That customer would just loose their saved addresses cart and the ability to look at their order history.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by rbelusa » Thu Dec 22, 2011 4:39 pm

a short one from my side. in germany this MOD is absolutely mandatory and also not to store the IP Adress, because in germany you are not allowed to run an ecommerce shop without these 2 functionality (plus some other points). You will get highly sued, before you open your store because of dataprivacy, datasecurity, law. thanks for this Mod/Help.

Newbie

Posts

Joined
Fri Sep 16, 2011 2:38 am

Post by Vytenis » Sun Jan 08, 2012 6:21 pm

Thanks for the mod, it really looks useful. Did anyone tried it with 1.5.1.x?

New member

Posts

Joined
Mon Aug 01, 2011 1:33 am

Post by robster » Mon Apr 30, 2018 9:49 pm

Did this mod ever get developed to be used in later versions of opencart such as 1.5.x 2.0 or later? I think it is a great idea, particularly with the upcoming GDPR data protection laws.

I know my place...!


User avatar
Active Member

Posts

Joined
Tue Jul 13, 2010 8:08 pm
Location - North Yorkshire, UK

Post by OSWorX » Tue May 01, 2018 5:40 pm

robster wrote:
Mon Apr 30, 2018 9:49 pm
Did this mod ever get developed to be used in later versions of opencart such as 1.5.x 2.0 or later? I think it is a great idea, particularly with the upcoming GDPR data protection laws.
Does no matter if this lines got updated for later versions or not

The GDPR has one rule (beside many others): customer shall be able to remove his account (deleting data associated with his person) at any time.

> The right to be forgotten <

This can be done automatically (via a form by the customer) or manually (by shopowner after request) after approval.

EXCEPT: personal data required for bookkeeping is not allowed to delete (depends on locale laws between 7 and 10 [ore more] years).
Otherwise you get in trouble with your financial department.

What can be done: except the sales data all other records can be anonymized.
And an existing newsletter subscription of this customer (which has to have a Double Optin solution at registration btw.) can be deleted - or if stored with IP > anonymized.

One exception from this rule exist: if a (criminal) court decision exists not to delete this data (e.g. in case of fraud or other criminal activity).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by straightlight » Wed May 02, 2018 10:59 pm

An update I have received today from Axelos / EXIN providers about the implementation of the GDPR restrictions in the ITIL Best Practices starting in the upcoming May 25.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ivan111 » Sat May 26, 2018 2:18 am

Is this a good PHP code for 1.5.6. I'm constantly getting a mistake. I get a white screen.

<?php
class ControllerAccountDelete extends Controller {
private $error = array();

public function index() {
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = HTTPS_SERVER . 'index.php?route=account/delete';

$this->redirect(HTTPS_SERVER . 'index.php?route=account/login');
}

$this->language->load('account/delete');

$this->document->title = $this->language->get('heading_title');

if (isset($this->request->post['password']) && $this->validate()) {
$this->load->model('account/customer');

$this->model_account_customer->deleteCustomer($this->customer->getId());

$this->redirect(HTTPS_SERVER);
}

$this->document->breadcrumbs = array();

$this->document->breadcrumbs[] = array(
'href' => HTTP_SERVER . 'index.php?route=common/home',
'text' => $this->language->get('text_home'),
'separator' => FALSE
);

$this->document->breadcrumbs[] = array(
'href' => HTTPS_SERVER . 'index.php?route=account/account',
'text' => $this->language->get('text_account'),
'separator' => $this->language->get('text_separator')
);

$this->document->breadcrumbs[] = array(
'href' => HTTPS_SERVER . 'index.php?route=account/delete',
'text' => $this->language->get('heading_title'),
'separator' => $this->language->get('text_separator')
);

$this->data['heading_title'] = $this->language->get('heading_title');

$this->data['text_password'] = $this->language->get('text_password');

$this->data['entry_password'] = $this->language->get('entry_password');

$this->data['button_continue'] = $this->language->get('button_continue');
$this->data['button_back'] = $this->language->get('button_back');

if (isset($this->error['confirm'])) {
$this->data['error_confirm'] = $this->error['confirm'];
} else {
$this->data['error_confirm'] = '';
}

$this->data['action'] = HTTPS_SERVER . 'index.php?route=account/delete';

if (isset($this->request->post['password'])) {
$this->data['password'] = $this->request->post['password'];
} else {
$this->data['password'] = '';
}

$this->data['back'] = HTTPS_SERVER . 'index.php?route=account/account';

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/delete.tpl')) {
$this->template = $this->config->get('config_template') . '/template/account/delete.tpl';
} else {
$this->template = 'default/template/account/delete.tpl';
}

$this->children = array(
'common/column_right',
'common/footer',
'common/column_left',
'common/header'
);

$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
}

private function validate() {
if (!$this->customer->login($this->customer->getEmail(), $this->request->post['password'])) {
$this->error['confirm'] = $this->language->get('error_confirm');
}

if (!$this->error) {
return TRUE;
} else {
return FALSE;
}
}
}
?>

Newbie

Posts

Joined
Sat May 26, 2018 2:12 am

Post by IP_CAM » Sun May 27, 2018 1:11 am

Well, after investing the equivalent of a few hundred Bucks in time :laugh: , looking for
1.5.6.4+ routines, possibly replacing some of the existing code, it now seems to work.
And without errors, as it looks, at least in a fully default 1.5.6.5_rc Version and Theme.
I will try it in one of my latest Testshops, and then decide, if it makes sense, to have it
built-in by default in my future work.
---
And to this:

Code: Select all

DO NOT LET PEOPLE DELETE YOUR CUSTOMER ACCOUNTS!!!
Their records are you proof of what they do. Erase that and it is ALL on you!
It does not matter, if an account is deleted, the full Proof of Sale Records still exists,
with Customer Invoice(s), Names and Addresses, in the Administration Section.
---
It would have been easy to do, for a Pro at least, but most don't care any longer about older
Versions, or then, they don't bother anymore, to assist others for free, to then even get called
names, like asshole, as it happen to me some hours ago, by some mannerless ignorant, unwilling
to read, or just unable to understand, on how to 'technically behave' around here first, to enable
someone, to reply in the first place.
---
It made me think about again, if it's worth it, to further share free knowledge here, and I am very
unsure, if and what answer I will find.
Ernie
---
( Code used from here at the OC Forum )
Delete Account for OC v.1.5.x - by use oc v.1.5.6.x Default Theme:
Image
---
( Bootstrap3-modified Mod, but Publisher + Links do not exist anymore )
Account Cancellation for OC v.1.5.x with Bootstrap-3 v.1.5.6.5_rc Theme:
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 18 guests