E commerce Magento用户产品访问历史记录
是否有magento商店、用户产品访问历史记录? 如果是,那么我如何取回它或 如果没有,我怎么做E commerce Magento用户产品访问历史记录,e-commerce,magento-1.7,E Commerce,Magento 1.7,是否有magento商店、用户产品访问历史记录? 如果是,那么我如何取回它或 如果没有,我怎么做 非常感谢您提供任何web链接或资源。您可以在事件之后使用目录\u产品\u加载\u创建观察者: <global> <events> <catalog_product_load_after> <observers> <yournamespace_yourmodulenam
非常感谢您提供任何web链接或资源。您可以在
事件之后使用目录\u产品\u加载\u创建观察者:
<global>
<events>
<catalog_product_load_after>
<observers>
<yournamespace_yourmodulename>
<type>model</type>
<class>yournamespace_yourmodulename/observer</class>
<method>saveProductVisitHistory</method>
</yournamespace_yourmodulename>
</observers>
</catalog_product_load_after>
</events>
</global>
public function saveProductVisitHistory(Varien_Event_Observer $observer) {
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
Mage::log('Customer ID: '.$customer->getId(), null, 'custom.log');
$product = $observer->getEvent()->getProduct();
Mage::log('Visited Product ID: '.$product->getId(), null, 'custom.log');
}
}