How to Show List of All Categories with Links at Sidebar on Category Page in Magento 2

in #magentoblog5 years ago

Hello, Magento Folks,

Last time we learned how you can Remove decimals from quantity in the product grid of Magento 2 admin. Today we are here to explain how you can show the list of all categories with links at the sidebar on the category page in Magento 2.

Show-Display-All-Categories-with-Links-on-Category-page-sidebar-in-Magento-2.png

When you need to show all of the categories to the customer, you can do so with the help of coding knowledge. You can show a list of all categories so the customer can easily navigate from one category to another with ease. The following code will add all of the categories with links to the sidebar of the category page.

1] First, we need to add 2columns-left.xml file at the following path:
app\code\Vendor\Extension\view\frontend\page_layout\2columns-left.xml

2] Now you need to add category.phtml at the following path:
app\code\Vendor\Extension\view\frontend\templates\category.phtml

3] Now You Need to create Categorylist.php file at the following path:
app\code\Vendor\Extension\Block\Categorylist.php

for more information visit this: https://magecomp.com/blog/show-list-categories-links-sidebar-category-page-magento-2/

Sort: