- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015
01:40 AM
05-28-2015
01:40 AM
Get customer data outside magneto
Hello All,<br />
I trying to get customer data outside magento dir using the code below<br />
<?php require_once 'app/Mage.php'; Mage::app('default'); Mage::getSingleton('core/session', array('name' => 'frontend')); if(Mage::getSingleton('customer/session')->isLoggedIn()){ $user = Mage::getSingleton('customer/session')->getCustomer(); echo $user->getId(); }else{ echo 'session Not Found'; exit; }
but this is not working <br />
can anyone till me where the error, or how can I get customer data outside magento ?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015
06:44 AM
05-28-2015
06:44 AM
Re: Get customer data outside magneto
Here's the way to get customer data outside magento:
<?php require_once '<<magento_root_directory>>/app/Mage.php'; Mage::app('default'); Mage::getSingleton('core/session', array('name' => 'frontend')); if(Mage::getSingleton('customer/session')->isLoggedIn()){ $user = Mage::getSingleton('customer/session')->getCustomer(); echo $user->getId(); }else{ echo 'session Not Found'; exit; } ?>
OR
Move File Inside Magento Root Directory.
Let me know if you face any query/concern regarding this.
Query solved? Accept as Solution.Thanks
Eric Baily
Eric Baily
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017
10:06 AM
02-27-2017
10:06 AM
Re: Get customer data outside Magento
Any idea how to do this in Magento 2.1?