如何在magento的产品页面中显示最近比较的产品?
我显示了“比较产品”和“最近查看的产品”,但无法显示“最近比较的产品”如何在magento的产品页面中显示最近比较的产品?,magento,Magento,我显示了“比较产品”和“最近查看的产品”,但无法显示“最近比较的产品” 我该怎么做..有人能帮忙吗?我没有尝试过这段代码,但希望它能帮助你 $items = Mage::getResourceModel('catalog/product_compare_item_collection') ->useProductItem(true) ->setStoreId(Mage::app()->getStore()->getId())
我该怎么做..有人能帮忙吗?我没有尝试过这段代码,但希望它能帮助你
$items = Mage::getResourceModel('catalog/product_compare_item_collection')
->useProductItem(true)
->setStoreId(Mage::app()->getStore()->getId());
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
$items->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId());
}
else {
$items->setVisitorId(Mage::getSingleton('log/visitor')->getId());
}
嘿,mufaddal,我应该把这个放在哪里?在phtml文件中,你把代码放在那里,用来显示最近比较过的产品