Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Prestashop 1.7.7.2 – Product variations Images dont change

I use Prestashop 1.7.7.2 and when I change the product variations, the corresponding image does not change.
The thumbnail underneath does change, but not the big one.
Of course, each declination has an image. I use a custom theme but it works fine at the installation.

(I have no Js errors)

All leads will be welcome..

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Resume:

replace $product.cover by $product.default_image

or remplace the complet file

Detail :

So the culprit is : the file –> product-cover-thumbnails.tpl (located in template/catalog/_partial)

The bug (well it’s not really a bug but a change of doctrine at Prestashop) occurs in case of update if you went for example from 1.7xx to 1.7.7

SMARTY condition

// line 28 
{if $product.cover}

// replace by
{if $product.default_image}
// line 29 
<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">

// replace by
<img class="js-qv-product-cover" src="{$product.default_image.bySize.large_default.url}" alt="{$product.default_image.legend}" title="{$product.default_image.legend}" style="width:100%;" itemprop="image">
// line 45 replace 
<img
              class="thumb js-thumb {if $image.id_image == $product.cover.id_image} selected {/if}"
              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"
            >

// replace by
<img
              class="thumb js-thumb {if $image.id_image == $product.default_image.id_image} selected {/if}"
              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"
            >
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading