Jump to content

Show second image in product categories page instead of default (cover) image

Recommended Posts

How can I show second image on categories page as thumbnails?

product-thumb-tpl has this:

          {if $product.default_image}
            {generateImagesSources image=$product.default_image size='home_default' lazyload=true}
            alt="{if !empty($product.default_image.legend)}{$product.default_image.legend}{else}{$product.name|truncate:30:'...'}{/if}"
          class="img-fluid rounded lazyload"


But I don't know what should be instead of $product.default_image to show the second image?

Link to comment
Share on other sites

  • 2 weeks later...

If you do the dump on top of the file, you can see it as an array



For example this code may work for you


 {if isset($product.images[1])}
 <img src="{$product.images[1].bySize.home_default.url}" />


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