0

I want to remove the title, filter and sort from the bottom toolbar on the category page and leave only the pager (pagination).

My toolbar phtml is located at

vendor/vendor_child/Magento_Catalog/templates/product/list/toolbar.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
/**
 * Product list toolbar
 *
 * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
 */
use Magento\Catalog\Model\Product\ProductList\Toolbar;
?>

<?php
$list_count = $this->helper('Ecomwares\Wokiee\Helper\Data')->getSystemValue('wokiee_settings/product_listing/list_count');
?>

<?php if ($block->getCollection()->getSize()): ?>
    <div class="toolbar toolbar-products" data-mage-init='<?= /* @escapeNotVerified */ $block->getWidgetOptionsJson() ?>'>
        <div class="tt-filters-options">
            <?php if ($this->helper('Ecomwares\Wokiee\Helper\Data')->checkPage() == 'catalog_category_view'): ?>
            <h1 class="tt-title">
                <?= $block->getLayout()->getBlock('page.main.title')->getPageTitle(); ?>
                <?php if ($list_count): ?>
                    <span class="tt-title-total">(<?= $block->getTotalNum(); ?>)</span>
                <?php endif; ?>
            </h1>
            <?php endif; ?>
            <?php echo $block->getChildHtml('category.description'); ?>
            <div class="tt-btn-toggle">
                <a href="#"><?= /* @escapeNotVerified */ __('Filter') ?></a>
            </div>
            <div class="tt-sort">
                <?php if ($block->isExpanded()): ?>
                    <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter_custom.phtml')) ?>
                <?php endif; ?>
                <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter_custom.phtml')) ?>
            </div>
            <?php if ($block->isExpanded()): ?>
                <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode_custom.phtml')) ?>
            <?php endif; ?>
        </div>
        <?= $block->getPagerHtml() ?>
    </div>

<?php endif ?>

and the category list.phtml file is located at

vendor/vendor_child/Magento_Catalog/templates/product/list.phtml

and the toolbar.phtml gets called for the top toolbar as such

<div class="top-toolbar">
    <?= $block->getToolbarHtml() ?>
</div>

and for the bottom toolbar as such

<div class="bottom-toolbar">
    <?= $block->getToolbarHtml() ?>
</div>

I want just the pager to show on the botttom toolbar so I changed it to

<div class="bottom-toolbar">
    <?= $block->getPagerHtml() ?>
</div>

However it doesn't work. Any idea what I'm doing wrong.

1

I had the same problem on mobile and i resolve it with CSS.

#mana_ajax_wrapper_category_products_list .toolbar-products:last-of-type, #mana_ajax_wrapper_search_result .toolbar-products:last-of-type{
    .open-filters{
        display: none;
    }
}
1
  • I've already done that, the thing is it loads view page source, and as a result shows 2 <h1> tags on the page. Which is why I want to remove it from the page. Apr 12 at 12:33

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.