Friday, August 5, 2011

Magento find how long customer is inactive?

$customer = Mage::getSingleton('customer/session')->getCustomer();
$log = Mage::getModel('log/customer')->load($customer->getId());
$inctive_time = now() - $log->getLastVisitAt();

No comments:

Post a Comment