Jump to content

Images adaptatives dans prestashop 1.7.7.5


Recommended Posts

1 minute ago, mfs83 said:

Et ça fonction vraiment ?

Bien sur c'est meme indispensable pour de bonne perf, perso je te conseille de faire du lazy loading + du responsive image avec la librairie Lazysizes: https://github.com/aFarkas/lazysizes

voila comment j'ai implenté ca sur mon site sur une page catégorie:

 <img
                src="{Link::getImageLink($product.link_rewrite,$img_cover.id_image,'cart_default')}"
                srcset="{Link::getImageLink($product.link_rewrite,$img_cover.id_image,'home_default')} 2x"
                  class="lazyload img-fluid"
                  data-src="{Link::getImageLink($product.link_rewrite,$img_cover.id_image,'home_default')}"
                 
                  alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{Manufacturer::getnamebyid($product.id_manufacturer)} {$product.name} {l s='cheap' d='Shop.Theme.Venusproduct'}{/if}"
                  loading="lazy"
                  data-full-size-image-url="{$product.cover.large.url}"
                  width="302"
                  height="302"
                />

un exemple: https://venus.paris/produits/soin-des-cheveux/creme-capillaire/

 

cordialement,

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...