Jump to content

Show first thumbnail of accessory


Recommended Posts

Hi,

 

I'm having a bit of an issue with accessories. I want the accessory-list to show the first thumbnail of a product as well as the product name.

 

I'm using the standard Prestashop template and figure I need to add something to fetch the image to this bit of code:

 

{foreach from=$accessories item=accessory name=accessories_list}
   {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
   <li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
    <h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}</a></h5>
   </li>
  {/foreach}

 

Anyone who's done this before or knows what needs to be added?

 

Cheers

Michael

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