Jump to content
thirty bees forum

Delete customer account?


Wartin

Recommended Posts

Hello. Is it possible to delete a customer account?

I read this thread(1) and it suggests that customers can't do it, or maybe I could find where to do it!

I found some paid modules for prestashop in order to make such deletion, it seems to me weird to pay for such a feature.

Thanks!

 

(1)

.

Link to comment
Share on other sites

My customers can.. Here is my account for example .. Is this what you are talking about below.. I've never actually deleted my account so not sure exactly what happens after this

1.JPG.e3666ecb9b38bbd1cad58a583f3b4503.JPG

and when you press erase you get this message

2.JPG.c4fb4ea52a85aec4da5d148af6b214f5.JPG

Edited by AndyC
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hello

I used the " Module Delete User own Account v1.0 - by Metacreo " with success on Tb1, works fine, it allows to see the data, delete the data only or delete data and the entire user account, exactly what is needed to fully comply with part of the GDPR rules, best of all does not require the admin to intervene, which is a great thing (at least for my case and point of view, and btw, on the gdpr directive it is specified that the user should be able to operate without admin help).

Now I am trying to use it on TB 1.3 and noticed that do not work any more.

The module behaviour on TB 1.3 is the following: apparently does work, does not throw errors, the procedures are carried out, but data and account are NOT deleted, so in fact the user even after deleting the entire account keeps logged in, can see own account and data and even logging out then can login again and see all his data intact, repeating the operation does output same result.

I tried it also on a fresh TB 1.3 installation with no other modules or themes installed but the original ones only.

what did change in Tb1.3 that prevents the old method to delete data and account to work?

I have no idea of where I should look at

By the way, apart fixing this one that to my knowledge is the only one being simple and perfectly doing those 3 simple things right and without any hassle, does anyone know a module that can cover all the GDPR requirements that is known to work just fine with TB1.3?

BTW, I agree with Slick 303, such a function should be built in and ready out of the box, so there would be no need to fiddle with modules and stuff to have this simple functionality, furthermore according to me all of the cookies and GDPR  directives should be covered with built in tools, this is not only a way to meet those requirements, but also a way to allow dealers to setup more transparent and user friendly e-commerce websites in general, also in countries where all these rules are not mandatory (btw, there are over 20 major countries in EU, it comprises a population of hundreds of millions, it is not a marginal little market)

Thank you for the help.

 

 

Link to comment
Share on other sites

I don't use this module and can't find it somewhere. In prestashop store there are a lot of such modules. 

Why it's no more working with 1.3? Not sure. I could imagine, that it's related to customer merge function. As you describe the problem, it seems that the customer is not deleted at all. 

From my own experience, I fear the deletion of customer accounts. It can bring up a lot of issues with external modules and maybe even with the core. I prefer to hold the customer object, but randomize it totally. What is the opinion of other coders like @datakick, @zen, @cienislaw, @musicmaster, @yaniv14

Edited by wakabayashi
Link to comment
Share on other sites

I have no problems deleting customers from back office.. or by script, but yes it needs to be well done in order to not add more structural bugs in the DB, it is sometimes needed when the DB is exploding, you get better performance by deleting 1000s of users not used anymore, if most of them come from marketplace, no need to keep them more than a year in the shop.. even 3 month is enough, as we keep all records in ERP as well.

 

 

Edited by zen
Link to comment
Share on other sites

  • 2 weeks later...

Hello

I agree with both, deleting might cause problems, but must be possible to delete things if done right, furthermore, definitely (being able to and) keeping the DB lean does not sound at all a bad idea, on the contrary I guess it is a good practice.

I checked again the "free userdel module by Metacreo", it was given out for free on prestashop forum, then disappeared, the files inside are all marked with a GPL3 license, so Think there is no problem to share it here.

IS it OK if I upload it here?

Will anyone of you experts fix it or at least help me to fix it (I am no coder btw, but I can follow instructions) and share it back so everyone can use it?

Maybe could also become a thirty bees free module once is fixed for good...

Thank you

Best regards

Link to comment
Share on other sites

I guess it's allowed then. I can take a short look and see what might cause the problem. But I am still a bit sceptical about deleting customer. What does it mean?

  • addresses?
  • orders?
  • module data?

Should this all be deleted? 😊 I doubt that every merchant want the same...

Link to comment
Share on other sites

Hello

Surely not all merchants want the same, but that's how it goes with every feature, module or else..., one thing is sure, to comply with GDPR all the data must be deleted when the user request it.

The userdel module actually offer just 3 options in the admin panel

  • there is a slider button to set the test mode or live mode, that to simulate and check if there are problems in general
  • a second slider button allows to set the module to process or not process orders
  • the third slider button if the second button is set to process orders allows to set the module to either keep the orders in the database in an anonymized form or delete the data

That's all, actually this module does not offer other options

On the front side the user in the account page has a button to see a resume of all the data (that is handled by the module, it could be enhanced to retrieve also other sensible data, e.g. newsletter subscription or else).

In that page there is another button with which the user can delete the data and the whole account, if clicked the data will be erased and the orders will be either erased or anonymized accordingly to what the admin settled in the back office

There are no other functions or options, at the moment, but I hope that this module could be developed to cover more aspects and possibilities.

The module is very simple, seems that the most is done in one file named userdel.php which counts about just 421 lines, even not being a coder I can see more less what does

It was working on previous versions of TB, since TB1.3 does not, as I wrote does not throw errors, pretty simply do not delete the account any more.

I attached it, I guess is not hard to fix it.

I also guess that could be used to enhance the TB GDPR compliance module (which by the way to be completed should also do more things), or something similar could be included in the core of TB.

As I wrote in more posts according to me an e-commerce platform today should natively include these functionalities.

Thank you

 

 

 


 

userdel-module.zip

Link to comment
Share on other sites

I dunno, but I get clear error messages when turning on debug mode. Have you used mailalerts/productcomments module before and uninstalled them? This seems to be an issue. 

The module is in general well structured and the code looks solid. But I think this is necessary:

        if (Module::isInstalled('mailalerts')) {
            $queries[] = "DELETE FROM `" . _DB_PREFIX_ . "mailalert_customer_oos` WHERE id_customer = " . (int)$customer->id;
        }

        if (Module::isInstalled('productcomments')) {
            // delete customer from productcomment module
            $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment` WHERE id_customer = ".(int)$customer->id;

            // clean productcomment module
            $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment_grade` WHERE `id_product_comment` NOT IN (SELECT `id_product_comment` FROM `"._DB_PREFIX_."product_comment`)";
            $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment_report` WHERE `id_product_comment` NOT IN (SELECT `id_product_comment` FROM `"._DB_PREFIX_."product_comment`)";
            $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment_usefulness` WHERE `id_product_comment` NOT IN (SELECT `id_product_comment` FROM `"._DB_PREFIX_."product_comment`)";
        }

I added the two if (Module::isInstalled...) in deleteDataFromPrestashop function.

Edited by wakabayashi
Link to comment
Share on other sites

Hello Wakabayashi

Thank you

I have the debug mode enabled on this test installation, but I did not see errors (???), it did look alike strange to me, now that you tried and saw the errors this fact does look even stranger!

I am taking of the debug function one can enable from within the backoffice (which I verified do act on the same file defines.inc.php in the config folder where I was used to manually set it as true or false...)

However, thanks to your analysis, verdict and hint I did a round of tests.

The mail alerts module was installed...

Off topic, I thought to check which email alerts were configured in it, then I enabled the "coverage" email too with 0(products) as a value and when I saved I got this warning:

" Warning line 235 in the file modules/mailalerts/mailalerts.php [2] count(): Parameter must be an array or an object that implements Countable "

This above is not related to the topic here, however I do report it in case is useful to check any other bug in TB, btw, I tried to change again the settings in the module and I could save without errors... so I have no idea of why the warning was shown...

the products comments module from TB was not installed, so eventually this was the culprit in my case.

I tried to install and activate it, thus tried to use the userdel module in the front shop, the module worked as expected...

I then added the two IF you suggested to the userdel.php file, tried again to use it in the front shop user account and it works fine in all cases now, just as should be.

Was not hard to find the lines where to add the IF conditions, however I post here below how the code is modified now in my userdel.php file, from the line 356:

 		// delete customer from mailalert module
		if (Module::isInstalled('mailalerts')) {
		$queries[] = "DELETE FROM `"._DB_PREFIX_."mailalert_customer_oos` WHERE id_customer = ".(int)$customer->id;
		}
        // delete customer from productcomment module
        if (Module::isInstalled('productcomments')) {
		$queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment` WHERE id_customer = ".(int)$customer->id;

        // clean productcomment module
        $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment_grade` WHERE `id_product_comment` NOT IN (SELECT `id_product_comment` FROM `"._DB_PREFIX_."product_comment`)";
        $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment_report` WHERE `id_product_comment` NOT IN (SELECT `id_product_comment` FROM `"._DB_PREFIX_."product_comment`)";
        $queries[] = "DELETE FROM `"._DB_PREFIX_."product_comment_usefulness` WHERE `id_product_comment` NOT IN (SELECT `id_product_comment` FROM `"._DB_PREFIX_."product_comment`)";
		}

Thank you 🙂

Link to comment
Share on other sites

12 hours ago, Raymond said:

I have the debug mode enabled on this test installation, but I did not see errors (???), it did look alike strange to me, now that you tried and saw the errors this fact does look even stranger!

Hard to say. I just turn on the debug mode in BO and it throw out a logical error (for coders). It tries to delete tables that might not be there. That's why I check, if these modules are installed or not...

The rest I just wondered: why is this module again needed? Is it about the frontOffice functionality, cause we have a delete button on customers in BO. But I guess it will just delete the core object customer and not any related table.

Link to comment
Share on other sites

Hello

Yes, I still got no idea why I could not see the errors... , is a log of all errors available, or maybe there is some setting to use to have a more verbose output?

This module is needed to comply with the GDPR law, should be built in the core.
Personally, since ever, I could never understand why there are so many CMS, e-commerce platforms and in general websites that do not have this feature to ease the user decision to quit and close the account.
 

Link to comment
Share on other sites

9 hours ago, Raymond said:

This module is needed to comply with the GDPR law, should be built in the core.

It's not. What is needed is for end user to be able to request deletion of PII, and that's not customer account. In fact, deletion of customer account can prohibited by other laws that have precedence over GDPR directive.

To be GDPR compliant, all that is needed is a notice somewhere on your website, where you inform you customers that they can request account deletion by sending email. You can then perform action manually. Note that such request will most likely never happen, as people are too lazy to actually put any effort into anything.

If it happens, you can go to customer account, and delete it (if there are no orders / invoices associated). If there are invoices, you have to decide according to your country laws if it's ok to delete such account. It's quite likely you are obliged by law to keep the records of sales for few years, so the deletion can't be allowed at this point.

Also -- GDPR says that you have to delete only PII information. That means, you don't have to actually delete the account itself, but you can simply mangle personal information (name, email, phone,...). Such account can no longer identify natural person, and therefore is not under GDPR directive. But it can still be very useful for analytics, trends investigation, etc. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...