Home > Mobile >  Prestashop 1.7.7.2 - Product variations Images dont change
Prestashop 1.7.7.2 - Product variations Images dont change

Time:11-17

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

CodePudding user response:

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 hljs-string">" 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
              hljs-keyword">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"
            >
  • Related