I'm trying to display the first 8 subcategories above the product listing on a select few category pages.

I know that I can easily do this using static blocks, but I'd rather use a custom template to do this.

I don't really need help with the PHP code to fetch the subcategories, I'm just not sure about the exact structure in magento 2 to use.

I know I need a custom .phtml template at least, but I'm not sure where to place the PHP methods to use in my template as I've never developed a custom module.

Also, I'm assuming that for each category that I'd want the subcategories to display on, I can use update the layout in the admin on the category's "custom design" tab.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.