i added one customer programmatically and send mail to that customer for new password and also in admin side i found that customer but when customer try to login with email id and password got error 'Invalid login or password' here is my code what is problem with this?

define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
ini_set('memory_limit', '-1'); //for unlimited memory being more trickey
ini_set('display_errors', 1);

$customer_email = 'test@testemail.com';  // email adress that will pass by the questionaire 
$customer_fname = 'test_firstname';      // we can set a tempory firstname here 
$customer_lname = 'test_lastname';       // we can set a tempory lastname here 
$passwordLength = 10;                    // the lenght of autogenerated password

$customer = Mage::getModel('customer/customer');
* Check if the email exist on the system.
* If YES,  it will not create a user account. 

if(!$customer->getId()) {

   //setting data such as email, firstname, lastname, and password 


  //the save the data and send the new account email.

catch(Exception $ex){

  • check the website_id in customer_entity table. what are the value of that? – Qaisar Satti Jul 2 '15 at 9:03
  • website_id is 1 – mit patel Jul 2 '15 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.