How to Block Magento 2 Moving Toolbar

In this blog, we will discuss how to block Magento 2 move toolbar. Let’s start with how to move the toolbar.

You can move toolbar in this way


or change the position of getToolbarHtml() ?> this code in list phtml

But the toolbar moves outside of category.products.list block. Then some error messages show.

For that when you move the toolbar before breadcrumbs of to the filter section you can move in this way:

1st You create Magento_Catalog\layout\catalog_category_view.xml in your theme and put this content



http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">









product_list_toolbar







After that Magento_Catalog\templates\product\toolbarcustom.phtml this file creat and put content here

getLoadedProductCollection();
?>
count()): ?>
getToolbarHtml() ?>

Conclusion:

Hope you have read the blog and understood how to block Magento 2 move toolbar. This is very important in eCommerce development. I have tested the code by myself. Please share your reviews in the comment section.

We Serve clients globally in diverse industries

Stay Upto Date With Our Newsletter.