查看的产品位于此处:
App/code/local/Mage/Reports/Block/Product/Viewed.php
我添加了以下代码:
class Mage_Reports_Block_Product_Viewed extends Mage_Reports_Block_Product_Abstract{
...
protected function _prepareLayout()
{
parent::_prepareLayout();
$toolbar = $this->getLayout()->createBlock('catalog/product_list_toolbar', microtime())
->setCollection($this->getProductCollection());
$pager = $this->getLayout()->createBlock('page/html_pager', microtime());
$toolbar->setChild('product_list_toolbar_pager', $pager);
$this->setChild('toolbar', $toolbar);
$this->getProductCollection()->load();
return $this;
}
public function getPagerHtml()
{
return $this->getChildHtml('toolbar');
}
}
我的模板应该是这样的:
<?php if ($_products = $this->getRecentlyViewedProducts()): ?>
<!-- top pagination -->
<?php echo $this->getPagerHtml(); ?>
<?php if($_collection->getSize()): ?>
...
<?php foreach ($_collection as $_item): ?>
...
<?php endforeach; ?>
<?php endif ?>
<!-- bottom pagination -->
<?php echo $this->getPagerHtml(); ?>
<?php endif ?>
我添加了无法在Viewed.php
. 有人可以帮我解决这个问题吗?
任何帮助将不胜感激。