Jump to content

Display a specefic product image in template

Recommended Posts

Hi Everybody, 

I started my first theming experience in prestashop. 

I would like to display a specific product image.

Today I have something like thaht in my template: 

<img src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">

But I would like to always display only the second image product and put the url in the src attribute. 

How I can access to this ? I didn't find a doc about the $product object yet.  

Share this post

Link to post
Share on other sites


With {debug} sentence anywhere inside your TPL you will have a popup screen with all the vars inside smarty. There you can find anything $product contains.


Share this post

Link to post
Share on other sites

Ho, my answer didn't work last time... 

This is exactly what I was looking for, special thanks for you ;) 

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More