【问题标题】:How to access magento Session in wordpress?如何在 wordpress 中访问 magento Session?
【发布时间】:2012-08-12 17:14:32
【问题描述】:

我已经阅读了很多类似的问题,

但没有找到答案

我必须在 wordpress 博客中显示客户姓名和购物车商品

我已经安装了 Mage Enabler。但它总是显示无效的 URL。 本地电脑的有效网址是什么?

所以我也做过类似的,

    require_once ("../app/Mage.php");
umask(0);
Mage::app();
Mage::getSingleton("core/session", array('name' => 'frontend'));
    $session = Mage::getSingleton("customer/session");

    if($session->isLoggedIn())
      {echo "YES";}
    else {echo "NO";}

我总是得到“不”.. :(

谁能帮我在wordpress中访问magento会话

【问题讨论】:

    标签: wordpress session magento integration


    【解决方案1】:

    代替:

    $session = Mage::getSingleton("customer/session");
    

    试试:

    $session=Mage::getSingleton('customer/session', array('name'=>'frontend') );
    

    祝你好运

    【讨论】:

      猜你喜欢
      • 2012-05-24
      • 2017-12-07
      • 2014-01-07
      • 2012-07-16
      • 1970-01-01
      • 1970-01-01
      • 2014-09-27
      • 2017-05-13
      • 2016-07-05
      相关资源
      最近更新 更多