0

I have installed a templatemonster template and the pager will not display in the toolbar in the category view. The product_list_toolbar_pager block appears to be correct in the layout/catalog.xml file:

<!--
Category default layout
-->

<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="left">
        <block type="catalog/navigation" name="catalog.leftnav" before="-" template="catalog/navigation/left.phtml"/>
    </reference>
    <reference name="content">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                    <!-- The following code shows how to set your own pager increments -->
...

template/catalog/product/list/toolbar.phtml also appears to call the getPagerHtml method correctly

<?php
/**
 * Product list toolbar
 *
 * @see Mage_Catalog_Block_Product_List_Toolbar
*/
?>
<?php if($this->getCollection()->getSize()): ?>
<div class="toolbar">
    <div class="pager">
        <p class="amount">
            <?php if($this->getLastPageNum()>1): ?>
                <?php echo $this->__('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
            <?php else: ?>
                <strong><?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?></strong>
            <?php endif; ?>
        </p>

        <div class="limiter">
            <label><?php echo $this->__('Show') ?></label>
            <select onchange="setLocation(this.value)">
            <?php foreach ($this->getAvailableLimit() as  $_key=>$_limit): ?>
                <option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
                    <?php echo $_limit ?>
                </option>
            <?php endforeach; ?>
            </select> <?php //echo $this->__('per page') ?>
        </div>

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

    </div>

The problem is that $this->getChild('product_list_toolbar_pager') returns false in Toolbar.php. For some reason $this->_children[$name] in the getChild() function in Abstract.php is not set (where $name is "product_list_toolbar_pager").

public function getPagerHtml()
{
    $pagerBlock = $this->getChild('product_list_toolbar_pager');

    if ($pagerBlock instanceof Varien_Object) {

The pager works fine in the base_default and rwd_default templates.

  • What have you tried so far? I would check to see if the theme does anything with the product_list_toolbar_pager block to begin with – ProcessEight Jun 18 '18 at 12:30
  • @sfrost2004 Could you be more specific? I was assuming that toolbar.phtml calling getPagerHtml() would be all that is required. If the data for product_list_toolbar_pager is loaded earlier in the code I'm not sure where I would begin looking for it. – Steve Clark Jun 18 '18 at 15:36
  • I would start by comparing the catalog.xml from your theme with the catalog.xml from the base_default or rwd_default themes to see what is different. I would guess that something in the theme is either unsetting the product_list_toolbar_pager block (or one of its' parent blocks) or it never gets set at all (depending on what the parent theme is). – ProcessEight Jun 18 '18 at 15:49
  • This theme is built off of the base_default theme. The catalog_category_default section is identical in the two catalog.xml files, except that the modified theme has appended <action method="setColumnCount"><columns>3</columns></action> to the list of action tags. The only difference I can find in the parent blocks is in page.xml where the parent of the core/text_list content block is the root block. The base_default theme calls for page/3columns.phtml"> whereas my template calls for 2columns-left, which shouldn't unset product_list_toolbar_pager. – Steve Clark Jun 18 '18 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.