0

enter image description here

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

1

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

0

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

app/design/frontend/Package/Theme/Magento_Catalog/templates/product/list.phtml

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

if($category->getId()!=13){
 echo $block->getToolbarHtml() 
}

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

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.