0
제품을 작동하지하여 볼 수 제품에 페이지 매김을 추가젠토 1.7 여기에 조회 ::
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
에서 작동하지 않는 코드가 추가되었습니다. 누군가이 문제를 해결할 수 있도록 도와 주실 수 있습니까?
도움을 주시면 감사하겠습니다.
이 클래스에 페이지 매김을 추가하는 방법'Mage_Reports_Block_Product_Viewed'? –