Juke29 Posted July 13, 2017 Share Posted July 13, 2017 (edited) Hello, Do anyone has any clue on how to display a different default product image on products and categories pages on Prestashop 1.7 ? For example : - a product picture with grey background on category listing, - and a red background on product page. I found 2 old results in the forums, but these are not working anymore with 1.7: https://www.prestashop.com/forums/topic/328948-16-different-image-for-cover-in-list-and-in-previewview/ https://www.prestashop.com/forums/topic/129341-resolu-miniature-produit-differente-de-la-photo-du-produit/ If anyone has ideas, thank you in advance for your help ! Edited February 13, 2018 by Juke29 (see edit history) Link to comment Share on other sites More sharing options...
Juke29 Posted July 13, 2017 Author Share Posted July 13, 2017 (edited) I found a temporary solution, displaying 2nd product image on product page, and still use cover (selected default) product image on category listing. Default img line in templates/catalog/_partials/product-cover-thumbnails.tpl I replaced : <img class="js-qv-product-cover" src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image"> I wrote this instead of the default img line in templates/catalog/_partials/product-cover-thumbnails.tpl (replaced line above by this below) : {if isset($product.images[1])} <img class="js-qv-product-cover" src="{$product.images[1].bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image"> {else} <img class="js-qv-product-cover" src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image"> {/if} Edited July 13, 2017 by Juke29 (see edit history) 1 2 Link to comment Share on other sites More sharing options...
Gunnar Posted May 20, 2019 Share Posted May 20, 2019 This solved a problem I've been looking for some weeks now. Thanks mate! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now