2012-05-02 164 views

回答

0

我没有试过这段代码,但希望它能帮助你。

$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()); 
     } 
+0

嘿mufaddal,我应该把这个..? – David

+1

在phtml文件中,您可以将您的代码显示最近比较的产品 – Mufaddal

相关问题