如何在产品列表中显示产品的封面图片和第二张图片 [英] how to display in product-list the cover image and the second image of a product
本文介绍了如何在产品列表中显示产品的封面图片和第二张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 prestashop 1.6 的新手,喜欢在 product-list.tpl 中为每个产品显示 2 张图片.我看到 getImageLink 显示封面图像.是否有类似的函数,其参数对应于列位置?谢谢你问候
i'm new to prestashop 1.6 and like to display 2 images per product in the product-list.tpl. I see that getImageLink display the cover image. Is there a similar function with an argument corresponding to the column position ? thank you regards
推荐答案
与其在 Product.php 中编写函数,不如通过在 id_image 旁边添加 +1 来获取第二张图片
Rather than writing function in Product.php simply get second image by adding +1 next to id_image
src="{$link->getImageLink($product.link_rewrite, $product.id_image+1, 'home_default')|escape:'html':'UTF-8'}"
这篇关于如何在产品列表中显示产品的封面图片和第二张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文