Page 1 of 1

Check for first time login

Posted: Wed Dec 20, 2017 11:34 pm
by rgbrewer
Hi guys,

Client asked me today to display a Modal when the customer first signs in for that day -- until dismissed.

I see oc_customer_login table, but reading the code it seems that table might be just logging *incorrect* login attempts? Or is date_updated the most recent successful login and the count is the number of logins that day?

2.3.0.2

Anyway, wondering how you guys would approach this.

Cheers

Re: Check for first time login

Posted: Thu Dec 21, 2017 12:00 am
by straightlight
Or is date_updated the most recent successful login and the count is the number of logins that day?
I believe you are referring to the date_modified field since the date_updated field does not exist in the customer_login table. However, your assumption is correct. The date_modified field gets updated as per the customer attempts to login into his account whenever a failed attempt is involved.

Re: Check for first time login

Posted: Thu Dec 21, 2017 12:08 am
by rgbrewer
Ah, yes. Thank you!

Re: Check for first time login

Posted: Thu Dec 21, 2017 12:12 am
by thekrotek
You need to look into customer_activity table and query it by "customer_id" and key "fields"

Re: Check for first time login

Posted: Thu Dec 21, 2017 2:04 am
by rgbrewer
My customer activity table is suspiciously empty... I have bypassed it somewhere. Thanks for the tip.

Re: Check for first time login

Posted: Thu Dec 21, 2017 2:21 am
by straightlight
Your assumption is correct. I do not see any codes in the v2.3.0.2 which reflects on the already existing table of the oc_customer_activity table. It might be missing from the core but may have been fixed afterwards with the more recent versions of OC.

Re: Check for first time login

Posted: Thu Dec 21, 2017 4:21 am
by thekrotek
There's a plenty code for different kinds of activity in 2.3.0.2 source. Search for "activity" in OC files.

Re: Check for first time login

Posted: Thu Dec 21, 2017 5:05 am
by straightlight
Sorry, it was a typo.

Re: Check for first time login

Posted: Thu Dec 21, 2017 5:09 am
by straightlight
catalog/model/account/activity.php file is the location.