Tuesday, July 26, 2011

Magento: How to get visitor or guest information and ip address?

//Get Visitor's information
  $visitorData = Mage::getSingleton('core/session')->getVisitorData();
 
  // printing visitor information data
  echo "
"; print_r($visitorData); echo "
"; // user's ip address (visitor's ip address) $remoteAddr = Mage::helper('core/http')->getRemoteAddr(true); // server's ip address (where the current script is) $serverAddr = Mage::helper('core/http')->getServerAddr(true);

5 comments:

  1. i want to show customer last login data in customer grid.How to do ?Please help me.

    ReplyDelete
  2. i want to show customer last login data in customer grid.How to do ?Please help me.

    ReplyDelete
  3. Hi swapna check this thread. Get last login details

    Use 'log/customer' Model.

    Thanks

    ReplyDelete
  4. Thanks for your help,but it is returning null.Please help me.

    ReplyDelete
  5. Generally when we set some configuration in admin configuration,it reflects in frontend . My task is create a setting option in configuration for customer.That configuration should reflect in admin panel of customer.for that i created an attribute in both configuration tab anf admin panel.Now i am not getting how to get that value in admin panel.Please help me ,It is very urgent for me.

    ReplyDelete