Jump to content

Change Thumbnails Size


Recommended Posts

Hello,
I have a problem with changing the sizes of the thumbnails. Although I have a small_default image type in the homepage on this particular module I would need it to be 85x85. But although I regenerated the thumbnails and turned off CCC and cache it still doesn't work. Do I need to edit a .php or .tpl file? I'm using PrestaShop 1.6.1.17. I also attached some pictures so that u can see the problem. I want the NATURAL photos to be 85x85, not resized from 320x320.

Capture.PNG

Untitled.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for responding so late. I checked the .tpl files of the module and I saw this piece of code:

<a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
                          <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}"
                               title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}"{if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image"/>
                        </a>

 

but it doesn't matter what I put in "home_default", it doesn't change anything...

Edited by PitisRadu (see edit history)
Link to comment
Share on other sites

you need to change home_default with small default (in the tpl) and eventually this {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height} with width:85px and height=85px (there is a variable for small_default too but I have no time to look for it now).

Link to comment
Share on other sites

2 hours ago, Rho_Bur said:

you need to change home_default with small default (in the tpl) and eventually this {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height} with width:85px and height=85px (there is a variable for small_default too but I have no time to look for it now).

still doesn't work, the code i tried after what you told me was this:

<a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
                          <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}"
                               title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" width=85px height=85px itemprop="image"/>
                        </a>
i also tried with width: and height: but still didn't work...

Link to comment
Share on other sites

If you change the code in the module's tpl and it doesn't get changed in the frontoffice it means one of these:

- the module installed the same tpl in your_theme/modules/module_name/views/templates/front/ and you need to change that one;

- another tpl is used like the theme's product-list.tpl or the themes's product-list-slider (if any)

Link to comment
Share on other sites

On 3/7/2018 at 11:43 AM, Rho_Bur said:

If you change the code in the module's tpl and it doesn't get changed in the frontoffice it means one of these:

- the module installed the same tpl in your_theme/modules/module_name/views/templates/front/ and you need to change that one;

- another tpl is used like the theme's product-list.tpl or the themes's product-list-slider (if any)

Hello, sorry for the delay, but after extended research I FINALLY FOUND WHERE TO EDIT THE FILE, it was as you said in a product list gallery .tpl . But although I changed the value to small_default, now there is another problem...Another products that are not in this module have the class that makes the files to small_default and it looks like in the photo attached. Now the code is this:
 

{if count($product_images) > 1}
  <div class="tmproductlistgallery {$smarty_settings.st_type|escape:'html':'UTF-8'}{if $smarty_settings.st_type == 'slideshow' && $smarty_settings.st_thumbnails && $smarty_settings.st_thumbnails_position == 'vertical'} vertical-thumbnails{/if}{if $smarty_settings.st_type == 'slideshow' && $smarty_settings.st_pager} slideshow-dots{/if}">
    <div class="tmproductlistgallery-images {$smarty_settings.st_roll_type|escape:'html':'UTF-8'}">
      {foreach from=$product_images item=image}
        {assign var=imageId value="`$product.id_product`-`$image.id_image`"}
        {if !empty($image.legend)}
          {assign var=imageTitle value=$image.legend|escape:'html':'UTF-8'}
        {else}
          {assign var=imageTitle value=$product.name|escape:'html':'UTF-8'}
        {/if}
        {if $image.cover == 1}
          <a class="product_img_link cover-image" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
            <img class="img-responsive" src="{$link->getImageLink($product.link_rewrite, $imageId, 'home_default')|escape:'html':'UTF-8'}" alt="{$imageTitle|escape:'html':'UTF-8'}" title="{$imageTitle|escape:'html':'UTF-8'}" />
          </a>
        {/if}
        {if $smarty_settings.st_type == 'rollover'}
          {if $image.cover != 1}
            <a class="product_img_link rollover-hover" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
              <img class="img-responsive" src="{$link->getImageLink($product.link_rewrite, $imageId, 'home_default')|escape:'html':'UTF-8'}" alt="{$imageTitle|escape:'html':'UTF-8'}" title="{$imageTitle|escape:'html':'UTF-8'}" />
            </a>
            {break}
          {/if}
        {else}
          {if $image.cover != 1}
            <a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
              <img class="img-responsive" data-lazy="{$link->getImageLink($product.link_rewrite, $imageId, 'home_default')|escape:'html':'UTF-8'}" alt="{$imageTitle|escape:'html':'UTF-8'}" title="{$imageTitle|escape:'html':'UTF-8'}" />
            </a>
          {/if}
        {/if}
      {/foreach}
    </div>
    {if $smarty_settings.st_type == 'slideshow' && $smarty_settings.st_thumbnails}
      <div class="slider tmproductlistgallery-thumbnails{if $smarty_settings.st_thumbnails_carousel} use-carousel{/if}{if count($product_images) <= $smarty_settings.st_thumbnails_count} less-visible{/if}">
        {foreach from=$product_images item=image name=image}
          {assign var=imageId value="`$product.id_product`-`$image.id_image`"}
          {assign var=imageVisible value=100/$smarty_settings.st_thumbnails_visible}
          {if !empty($image.legend)}
            {assign var=imageTitle value=$image.legend|escape:'html':'UTF-8'}
          {else}
            {assign var=imageTitle value=$product.name|escape:'html':'UTF-8'}
          {/if}
          {if $smarty.foreach.image.iteration < $smarty_settings.st_nb_items + 1}
            <div id="thumb-{$product.id_product|escape:'html':'UTF-8'}-{$image.id_image|escape:'html':'UTF-8'}" class="gallery-image-thumb{if $image.cover == 1} active{/if}"{if !$smarty_settings.st_thumbnails_carousel && $smarty_settings.st_thumbnails_position == 'horizontal'} style="max-width: {$imageVisible|escape:'html':'UTF-8'}%"{/if}>
              <span data-href="{$link->getImageLink($product.link_rewrite, $imageId, 'home_default')|escape:'html':'UTF-8'}">
                <img class="img-responsive" id="thumb-{$image.id_image|escape:'html':'UTF-8'}" {if $smarty_settings.st_thumbnails_position == 'horizontal' && $smarty_settings.st_thumbnails_carousel}data-lazy{else}src{/if}="{$link->getImageLink($product.link_rewrite, $imageId, 'home_default')|escape:'html':'UTF-8'}" alt="{$imageTitle|escape:'html':'UTF-8'}" title="{$imageTitle|escape:'html':'UTF-8'}" itemprop="image" />
              </span>
            </div>
          {/if}
        {/foreach}
      </div>
    {/if}
  </div>
{else}
  {foreach from=$product_images item=image}
    {assign var=imageId value="`$product.id_product`-`$image.id_image`"}
    {if !empty($image.legend)}
      {assign var=imageTitle value=$image.legend|escape:'html':'UTF-8'}
    {else}
      {assign var=imageTitle value=$product.name|escape:'html':'UTF-8'}
    {/if}
    <a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
      <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $imageId, 'home_default')|escape:'html':'UTF-8'}" alt="{$imageTitle|escape:'html':'UTF-8'}" title="{$imageTitle|escape:'html':'UTF-8'}" />
    </a>
  {/foreach}
{/if}

the site is also magazinlumeacopiilor.ro, so could you please help me with this one last thing? It would help a lot! Thanks

Capture.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...