Jump to content

Generate password for costumers myself?


Recommended Posts

I have some problems with some costumers that doesn't receive password-emails when they ask for them.
I made a mistake when I moved the shop to a new host and forgot the COOKIE_KEY so now most old passwords are not valid (and no, I'm not going to change the cookie key now as it will give me even more problems...).
My customers try to click on "forgot password" and enter their emailaddress and wait. Nothing arrives.

I have tried my own "test account" and that works fine.
I have asked my costumers to check their spam emails, but it's not there either.

So my question is:
Can I generate a password for the costumer on my own in some way? And how is that done?

  • Like 1
Link to comment
Share on other sites

you can reset customer password at your back office admin page.

log in to you back office admin
select Customers tab
Find the customer you want to change password and click "edit" icon at right end
Input new password at customer detailed information page and click save

  • Like 1
Link to comment
Share on other sites

Here is a simple sample,

the function generate password

   function genRandomString($length=8) 
   {
       $characters = "0123456789abcdefghijklmnopqrstuvwxyz";
       $string ="";    
       for ($p = 0; $p < $length; $p++) {
           $string .= $characters[mt_rand(0, strlen($characters) -1 )];
       }
       return $string;
   }



the code to encrypt with your store cookie key

   $tmppass = genRandomString();
   $passwd = md5(_COOKIE_KEY_ . $tmppass);

  • Like 1
Link to comment
Share on other sites

  • 8 months later...
Would you please allow me know where to put these codes? Which lines?

Also is there a way to use the shop to send emails to customers who have not placed any order yet but have signed as a customer?

 

 

Actually, there is a better way to do that. You don't have to put those code any where.

PrestaShop Tools class has standard function is ready for you to use.

 

All you need to do is call this function

 

Tools::passwdGen();

  • Like 1
Link to comment
Share on other sites

I use version 1.3.2.3 that this function is not available. So, I need to know where to put the codes.

 

 

 

The below function is also available in 1.3.2.3

Tools::passwdGen();

I have other questions too but in the pages of the forum I cannot find where the link is. Would you please help?

 

 

Sorry, I am not sure what page you are referring to.

Link to comment
Share on other sites

×
×
  • Create New...