Jump to content

Subcategories images change square 125x by 125x to rectangle 125x by 31x ?


 Share

Recommended Posts

Hi prestashop users can we please change the default image size off the subcategories preview images ?

 

Example this square preview image  of the subcategories is just ugly ;( http://mobile-repair.eu/en/14-iphone-repair

 

Because like it is we get a 125 by 125x square with a small rectangule picture insside

because the  original image  taken from the real categorie image  is 870x by 217x so the preview should be 125x by 31x . not a 125x square

 

Can someone please explain how to add a image size just four the subcategories images

Thank you

.

post-730936-0-21631100-1396318149_thumb.png

Edited by marcolipe (see edit history)

Share this post


Link to post
Share on other sites

Hey Marcolipe

 

You can do it like this:

 

In yourtheme/category.tpl find this code:

{if $subcategory.id_image}
    <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
    <img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}

change to this:

{if $subcategory.id_image}
    <img class="replace-2x img-responsive" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'category_default')|escape:'html':'UTF-8'}" alt="" width="{$categorySize.width}" height="{$categorySize.height}" />
{else}
    <img class="replace-2x img-responsive" src="{$img_cat_dir}default-category_default.jpg" alt="" width="{$categorySize.width}" height="{$categorySize.height}" />
{/if}
  • Like 3

Share this post


Link to post
Share on other sites

  • 7 months later...

Thanks dioniz,

your solution is running perfectly with 1.6.0.9 version

Also, for better view, it's necessary to modify /themes/default-bootstrap/css/category.css in the line 50: replace the value of "height: 202px;" by "height: 125px;" for example.

Edited by Goyo (see edit history)

Share this post


Link to post
Share on other sites

 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More