enter image description here

SOLUTION : user this code what is the best solution : for that is this correct or is there any other solution


It is better to use remove="true" if you don't want it on the page.
Check the difference between remove and display attributes at http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html

| improve this answer | |

Toolbar can be Removed by commenting in the current theme directory.


Comment code at 2 places in the file.

<?php //echo $block->getToolbarHtml() ?>

As you want to hide for certain category , hide it for category_id

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category

 echo $block->getToolbarHtml() 

Say your category id is 13, so it will not be displayed in case of it.

| improve this answer | |

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.