Skip to content

Instantly share code, notes, and snippets.

@codesprint
Last active August 29, 2015 14:19
Show Gist options
  • Save codesprint/e8c8a9fe328323a9fec8 to your computer and use it in GitHub Desktop.
Save codesprint/e8c8a9fe328323a9fec8 to your computer and use it in GitHub Desktop.
magento get customer Id from Session / get session Id from Session
<?
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
$customerId = $customer->getId();
}
?>
<?
$sessionId = Mage::getSingleton("core/session")->getEncryptedSessionId();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment