Jump to content

Choisir le nombre de thumbnails afficher sur la page produit


Recommended Posts

Bonjour,

 

Je souhaiterais pouvoir afficher qu'une photo thumbnails sur ma page produit, Par défaut prestashop m'affiche toutes les photos correspondante au produit.

 

Comment faire ?

 

Cordialement.

Link to comment
Share on other sites

Bonjour,

 

la solution se trouve, dans le fichier product.tpl :

 

{if isset($images) && count($images) > 0}
       <!-- thumbnails -->
       <div id="views_block" {if isset($images) && count($images) < 2}class="hidden"{/if}>
       {if isset($images) && count($images) > 3}<span class="view_scroll_spacer"><a id="view_scroll_left" class="hidden" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Previous'}</a></span>{/if}
       <div id="thumbs_list">
           <ul id="thumbs_list_frame">
               {if isset($images)}
                   {foreach from=$images item=image name=thumbnails}
                   {assign var=imageIds value="`$product->id`-`$image.id_image`"}
                   <li id="thumbnail_{$image.id_image}">
                       <a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">
                           <img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
                       </a>
                   </li>
                   {/foreach}
               {/if}
           </ul>
       </div>
       {if isset($images) && count($images) > 3}<a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Next'}</a>{/if}
       </div>
       {/if}

 

voici la partie du code qui affiche les thumbnails, si tu veux afficher qu'une seule thumbnail il te suffit de retirer la boucle foreach et de specifier le 'id' de la photo a afficher.

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...