Mage Enabler customer session data not showing in wp
-
Hey, I’m trying to get mage-enabler to share topLinks with my wp cms. Im getting some session data showing up no problems, but the cart items data and login/out link data (isLoggedIn) are not coming through.
Here’s my code:
`
<?php
//called at the top of header.php before any output
Mage::getSingleton(‘core/session’, array(‘name’ => ‘frontend’));
$session = Mage::getSingleton(“customer/session”);
$magento_block = Mage::getSingleton(‘core/layout’);
?>
`<?php magelinks($session,$magento_block); ?>
`
<?php
function magelinks($session,$magento_block){if(class_exists(‘Mage’)){
# Initiate Blocks
$linksBlock = $magento_block->createBlock(“page/template_links”);$checkoutLinksBlock = $magento_block->createBlock(“checkout/links”);
$checkoutLinksBlock->setParentBlock($linksBlock);# Add Links
$linksBlock->addLink($linksBlock->__(‘My Account’), ‘store/customer/account’, $linksBlock->__(‘My Account’), true, array(), 10, ‘class=”first”‘);
$checkoutLinksBlock->addCartLink();
$checkoutLinksBlock->addCheckoutLink();if ($session->isLoggedIn()) {
$linksBlock->addLink($linksBlock->__(‘Log Out’), ‘store/customer/account/logout’, $linksBlock->__(‘Log Out’), true, array(), 100, ‘class=”last”‘);
} else {
$linksBlock->addLink($linksBlock->__(‘Log In’), ‘store/customer/account/login’, $linksBlock->__(‘Log In’), true, array(), 100, ‘class=”last”‘);
}echo $magento_message.”.$linksBlock->renderView().”;
}
}?>
`
- The topic ‘Mage Enabler customer session data not showing in wp’ is closed to new replies.