Jump to content

[Résolu] Choix de l'image par défaut - page product.tpl


Recommended Posts

Bonjour,<br/><br/>J'ai le plaisir de vous faire partager une solution simple pour choisir son image par défait dans la page produit<br/><br/>Remplacer <br/><br/>

<div id="image-block"><br/>        {if $have_image}<br/>            <img >getImageLink($product->link_rewrite, $cover.id_image, 'large')}"<br/>                {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}" /><br/>        {else}<br/>            <img src="{$img_prod_dir}{$lang_iso}-default-large.jpg" id="bigpic" alt="">name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" /><br/>        {/if}<br/>        </div>

<br/><br/>Par <br/><br/><div id="image-block"><br/> {if $have_image}<br/>{foreach from=$images item=image name=bigimage} {if $smarty.foreach.bigimage.index==1} <img id="bigpic">getImageLink($product->link_rewrite, $image.id_image,'large')}" <br/>title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" > <br/> {/if} {/foreach}<br/> {else}<br/> <img src="{$img_prod_dir}{$lang_iso}-default-large.jpg" id="bigpic" alt="">name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" /><br/> {/if}<br/> <br/> </div><br/><br/>Changer l'ordre des Thumbnails dans la BO pour choisir votre image par défaut.<br/><br/>Cette solution est sûrement perfectible et vos avis sont les bienvenus !<br/><br/>Voilou

 

Non résolu depuis basculement vers 1.4.4.1 !

Link to comment
Share on other sites

  • 2 months later...

Image dans product.tpl différente de l'image par défaut

 

Voici la maj pour 1.4.4.1

 

{if $have_image}

               {foreach from=$images item=image name=bigimage} 

				{assign var=imageIds value="`$product->id`-`$image.id_image`"}
               {if $smarty.foreach.bigimage.index==1}
			<img  id="bigpic" src="{$link->getImageLink($product->link_rewrite, $imageIds,'large')}"
			 title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}"  width="{$largeSize.width}" height="{$largeSize.height}" />
{/if} {/foreach}	{else}
		<img src="{$img_prod_dir}{$lang_iso}-default-large.jpg" id="bigpic" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" />
	{/if}

 

Cordialement,

Link to comment
Share on other sites

  • 7 months later...

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