How to Display Subcategories on Category Page in Prestashop 1.7?

After upgrading PrestaShop 1.6, are you missing the absence of subcategories images on the category page in PrestaShop 1.7 classic theme or other themes? Let’s take them back in a few simple steps!

1. To display subcategories on category page

To change category.tpl file, Which is responsible for category page. Follow this path to locate the correct file: themes/classic/templates/catalog/listing/category.tpl

Open the file and paste the below code inside {block name=’product_list_header’}{/block} block, just before it closes:

{/block}

Now, the modified file will looks like as below:

{/block} {/block}

Above code checks if the browsed category page contains any subcategories and if so – this code builds a list of available subcategories.

subcategory-block-prestashop

To give a better look, let’s add the CSS!

2. Add CSS style to subcategory list

Open theme.css file, located in themes\classic\assets\css. At the very end, Add our CSS style as below:

subcategory-thumbnail-prestashop

You might need to change the style depending on your category cover image size and Save and clear the cache. Now, It’s done!

If you have any doubts or questions, you’re welcome to ask in comments.

2 Comments

  1. It works as promissed.
    Thank you!
    Karel

  2. I have one question… Is there a way to wrap the category text? Some of my sub categories are a bit longer and the category text is not wrapping. Appreciate any help.

Leave a Reply

Your email address will not be published. Required fields are marked *