JordanBTD Posted April 8, 2019 Share Posted April 8, 2019 (edited) Hello, Excuse me for my english. I am kinda new to Prestashop development, I would like to display the first image of the color declination for each color declination, instead of only an input color. I have to admit that I don't really know where to search... I firstly tried to modify src/Adapter/Image/ImageRetriever.php in this way : (line 105) foreach ($images as $image) { // if (in_array($productAttributeId, $image['associatedVariants'])) { $filteredImages[] = $image; // } } And then tried this in product-variants.tpl line 42: {foreach from=$product.images item=image} <li class="thumb-container"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}> <img class="thumb js-thumb" data-image-medium-src="{$image.bySize.medium_default.url}" data-image-large-src="{$image.bySize.large_default.url}" src="{$image.bySize.home_default.url}" alt="{$image.legend}" title="{$image.legend}" width="100" itemprop="image" > {/foreach} </li> {/foreach} I know it won't work but still don't know where to start actually... If you could help me a bit, I would appreciate that a lot. Thank you EDIT : I'm working on a Prestashop 1.7.5.1 and what I'm trying to do it's something like that: https://www.texet.fr/B2B - Texet France/Procut-by-Brand/Harvest/2145005-be2822ea/?initialcolorCode=490 Edited April 8, 2019 by JordanBTD (see edit history) Link to comment Share on other sites More sharing options...
JordanBTD Posted April 9, 2019 Author Share Posted April 9, 2019 Up Link to comment Share on other sites More sharing options...
nikoz Posted January 21, 2021 Share Posted January 21, 2021 Hi Jordan, I am also interested on this. Did you manage to solve it ? Can you please share here what you did ? Thanks Link to comment Share on other sites More sharing options...
Aldeag Posted January 21, 2021 Share Posted January 21, 2021 I used this free module which I found https://www.sunnytoo.com/57773/show-combination-images-textures-free-prestashop-module It worked right in my Prestashop 1.7.6.3 Buy I updated to 1.7.7 and the module does not work, it needs an update. So if you are under 1.7.7 try it. 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