【问题标题】:Get recently viewed products array in Magento在 Magento 中获取最近查看的产品数组
【发布时间】:2015-03-30 04:28:32
【问题描述】:

我遇到了一个问题,我必须高度定制一个 magento 电子商务商店。 因此,如果我可以在

中获得请求的数据,那就太好了

\app\design\frontend\avalanche\default\template\reports\product_viewed_details.phtml

通过

$this->getRecentlyViewedProducts()




我已经尝试通过

Mage::getBlockSingleton('report/product_view')->getRecentlyViewedProducts();

,但我唯一得到的是一个空数组。


有人可以帮我吗?我在这边开车有点疯狂。

【问题讨论】:

    标签: php magento


    【解决方案1】:

    你试过了吗:

    $collection = Mage::getSingleton('Mage_Reports_Block_Product_Viewed')->getItemsCollection();

    【讨论】:

      【解决方案2】:

      您还可以使用别名来生成更“友好”的代码:

      $collection = Mage::getBlockSingleton('reports/product_viewed')->getItemsCollection();

      【讨论】:

      • 如何在 Magento 2 中获得相同的收藏?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多