16th Feb 2009
Showing Subcategories in Magento Static Blocks
I’m currently building a new ecommerce stored based on the latest version of Magento. Whilst the navigation options available surpass most other products on the market there are still the occasional problems to deal with. I found that in some scenarios I wanted to display subcategories in the main body of a category page rather than them being restricted solely to the navigation bar.
This is particularly useful if you have a main level category with many subcategories and don’t wish to have a random selection of products or a more standard static block to be displayed if a customer lands on the main category.
The code is simple to implement though it’s not guaranteed to work with future versions of Magento – hence the MIT license designation. The website I’m working on is still under development so there is no example of this modification however the Gist below includes all of the code required to get up and running.
Did you enjoy this article? Follow me on Twitter.