Jump to content

Displaying Multiple Images on Product Page


Recommended Posts

Hello,

Currently, my PS theme only displays one image per product, and looks like this..

http://iridesideways.com/product.php?id_product=74

What I would like to happen is, when more images are added via the admin control panel, they are displayed underneath the first image, same size etc.

Here is the piece of code that controls the image being displayed..


{if $have_image}

getImageLink($product->link_rewrite, $cover.id_image, 'large')}" {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"/>

{else}

name|escape:'htmlall':'UTF-8'}" />

{/if}



What changes do I need to make?

Cheers.

Link to comment
Share on other sites

Try with something like this

        {if count($images) > 0}


               {foreach from=$images item=image name=img}
               {assign var=imageIds value=`$product->id`-`$image.id_image`}

getImageLink($product->link_rewrite, $imageIds, 'large')}" alt="{$image.legend|htmlspecialchars}"  />

               {/foreach}


       {/if}



Than write some css for it.

Link to comment
Share on other sites

{if count($images) > 0}


               {foreach from=$images item=image name=img}
               {assign var=imageIds value=`$product->id`-`$image.id_image`}

                       <img id="image_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'large')}" alt="{$image.legend|htmlspecialchars}"  />

               {/foreach}


       {/if} 

Link to comment
Share on other sites

No problem and for displaying all code i didn't follow this advice as usual i do.

The forums strip all href, img and script tags for security reasons. I get around these problems in my code contributions by changing <a href to <a href, <img src to <img src and <script> to <script>.


If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title.
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...