Magento 1.6.
Within the login processing code, is it possible to find out when the user/customer has logged in for the very first time?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your Magento is configured not to use double-opt-in (email confirmation) for customer registrations, then you can use what @PauGNU already posted:
But when it comes to double-opt-in, Magento creates the customer account immediately, i.e. setting
created_atto the current system time, but does not activate it (so that customer cannot login before confirming) and only sends a confirmation mail.This means an unkown delay (minutes, days, weeks, whatever) between
created_atand the very first login, socreated_atwouldn’t be of use anymore.Actually, Magento has a place, where customer login times are being tracked by default: the table field
log_customer.login_at, accessible byMage_Log_Model_Customer, for example.But, if you plan to use it:
In that case, I’d prefer identifying the most proper event, hooking into it and saving only the very first login time per customer to a separate table.