Is it possible to use the catalog collection pager for the wishlist, and if so how can I implement this into the wishlist?
danny (OP) already self-answered the question.
Quote:
Ok, i've found the solution here but i'll post it here too for a better code highlighting:
Create a new modul and overwrite the wishlist block located in: code/core/Mage/Wishlist/Block/Customer/Wishlist.php
and add the following to your Wishlist.php
class Company_Wishlist_Block_Customer_Wishlist extends Mage_Wishlist_Block_Customer_Wishlist
{
protected function _prepareLayout()
{
parent::_prepareLayout();
$pager = $this->getLayout()
->createBlock('page/html_pager', 'wishlist.customer.pager')
->setCollection($this->getWishlist());
$this->setChild('pager', $pager);
$this->getWishlist()->load();
return $this;
}
public function getPagerHtml()
{
return $this->getChildHtml('pager');
}
}
now add <?php echo $this->getPagerHtml(); ?>
to the start and/or end of the view.phtml located in: app/design/frontend/default/your_theme/template/wishlist/view.phtml. that should do the trick.
Note: It's absolutely OK to self-answer your own question. Please just post it as an real answer, but not in a question or comment. Posting as real answer helps to keep the "Unanswered" list more clear (avoids making other people wasting their time).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With