Add Lazy Loading to images in Description

Tagged: 

ThemeBurn SupportForumsOpenCart ThemesShoppica 2 OpenCart ThemeAdd Lazy Loading to images in Description

This topic has been marked as not resolved.

Hello, I am trying to add lazy loading in images in description by adding the class = “lazyloaded”.
However, images in the descriptions seems not to be affected by this class.

I can see from the rest of the images in the website that they are “lazyloaded”, but when I scroll down to the images in the description, they are all loaded already.

How to achieve this?

thanks

January 17, 2018 at 4:45 am #63191

Hi,

You could add lazyload images manually, but you need to follow the this documentation:

https://github.com/aFarkas/lazysizes

We will add an automatic image lazyloading with the next version. Until then you can follow these steps to implement it:

1) Open system/vendor/BurnEngine/widget/ProductDescriptionSystemWidget.php

2) Find this line:

$content = str_replace('panel-heading', $title_classes, $content);

3) Insert this code right afterwards:

if ($this->themeData['system']['image_lazyload']) {
    $content = $this->getThemeModel()->alignImagesAttributes($content);
}

P.S. Be aware that your description images have width and height inserted.

BR,
ThemeBurn team

January 21, 2018 at 7:35 pm #63244
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.