Pagination Missing in Magento 2 Catalog

catalogmagento2pagination

I am working with Magento2. Category pages seem to be not calling the Pagination at all.

I can see in toolbar.phtml

<?php echo $block->getPagerHtml() ?>

it is there correctly but doesn't show on the category page, and can't find the call needed for the XML in case this is the issue

To note, the category page has over 15 products and the Pagination doesn't display in the source

Best Answer

You should add this method to your class if you haven't added yet. If you don't see it yet, you should debug this method. Don't forget to add your own _getProductCollection method with your collection, and setCollection() nethod.

/**
 * Retrieve Toolbar block
 *
 * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
 */
public function getToolbarBlock()
{
    $blockName = $this->getToolbarBlockName();
    if ($blockName) {
        $block = $this->getLayout()->getBlock($blockName);
        if ($block) {
            return $block;
        }
    }
    $block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, uniqid(microtime()));
    return $block;
}
Related Topic