Posted By

necode on 08/02/11


Tagged

customer magento Inactive


Versions (?)

Magento How long customer is inactive


 / Published in: PHP
 

URL: http://magentocookbook.wordpress.com/category/magento-coding/

How long customer is inactive ?

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

Report this snippet  

You need to login to post a comment.