0
我想爲網站上的每位訪問者記錄最近查看的產品。爲此,我相信最好的方式是通過cookie /會話ID登錄。我怎樣才能得到會話ID /誰沒有登錄訪客的餅乾。Magento:如何在前臺獲取訪問者的Cookie或會話ID
感謝,
我想爲網站上的每位訪問者記錄最近查看的產品。爲此,我相信最好的方式是通過cookie /會話ID登錄。我怎樣才能得到會話ID /誰沒有登錄訪客的餅乾。Magento:如何在前臺獲取訪問者的Cookie或會話ID
感謝,
你可以得到由session
$vistitorId = Mage::getModel('core/session')->getVisitorId();
訪問者ID來獲得餅乾
Mage::app()->getRequest()->getCookie();
獲得會話ID
$session = Mage::getSingleton('customer/session', array('name' => 'frontend'));
echo $session->getId();
echo $session->getCustomerId();
FYI:有可用於最近觀看產品
默認Magento的功能,請檢查下面的網址