Posts

Showing posts from September, 2024

How to make the Prestashop 1.7 Classic (default) theme display the thumbnail uploaded for category when displayed as a subcategory.

Edit the sub category template file  /themes/classic/templates/catalog/_partials/subcategories.tpl Edit the following line to make the image url point to the thumbnail image {if !empty($subcategory.image.large.url)} <img class="replace-2x" src="{$subcategory.image. small .url}" alt="{$subcategory.name|escape:'html':'UTF-8'}" loading="lazy" width="141" height="180"/> {/if}

How to make the category images responsive to screen size in Classic (default) theme in Prestashop 1.7

Firstly Edit the theme.css to remove any image size restrictions.  \ themes \ classic \ asset \ css \ theme.css -> find ->  .block-category .category-cover img -> delete/comment width and height values. .block-category .category-cover img { /* width: 141px; */ /* height: 180px; */ } Next edit the category-header.tpl: /themes/classic/templates/catalog/_partials/category-header.tpl Edit the following lines to make the image class img-fluid {if !empty($category.image.large.url)} <div class="category-cover"> <img class="img-fluid" src="{$category.image.bySize.category_default.url}" alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}" loading="lazy"> </div> {/if} Now, clear cache and recompile template files from the performance menu in the prestashop backoffice.