Close

Lazy loading feature

adca
2 months ago
#15841 Quote
Avatar
  • 3
Is this theme has lazy loading product images feature? I assumed there is, because theme demo looks good. But in production mode theme downloads all images same time. I have found a setting that named: emporiumthemesettings.lazyloadimages
Setting value is False. When i switched to true, all images show empty. I guess there is a lazy loading feture but i could not configure.

How to activate this feature?
Boyko
2 months ago
#15842 Quote
Avatar
  • Moderator
  • 1437
adca wrote:
Is this theme has lazy loading product images feature? I assumed there is, because theme demo looks good. But in production mode theme downloads all images same time. I have found a setting that named: emporiumthemesettings.lazyloadimages
Setting value is False. When i switched to true, all images show empty. I guess there is a lazy loading feture but i could not configure.

How to activate this feature?


Hi adca,

All our themes support lazy loading of images out of the box and they should work like this by default.
If you are using the latest version of our themes for nopCommerce 4.1/4.2 then this setting is automatically enabled. Here is the exact setting (it is not theme specific anymore):

sevenspikescommonsettings.lazyloadimages

Hope this helps!
Regards,
Boyko Stanev
Nop-Templates.com
adca
2 months ago
#15844 Quote
Avatar
  • 3
I am using nopcommerce 4.1.

That setting was not added. I add with True value. And nothing changed.

I checked the code: in 4.1 and 4.2 versions. All of them uses same setting key: EmporiumThemeSettings.LazyLoadImages

Even there is no setting key starts with sevenspikescommonsettings
anton_ivanov
2 months ago
#15848 Quote
Avatar
  • Moderator
  • 265
Hello,

Please make sure you've downloaded the latest version of the Emporium theme for nopCommerce 4.1 (your last download for 4.1 is from February). After that, you will be able to see the sevenspikescommonsettings.lazyloadimages setting in the Administration -> Configuration -> Settings -> All Settings page and set it to True.

Hope that helps!
Regards,
Anton Ivanov
Nop-Templates.com
adca
2 months ago
#15850 Quote
Avatar
  • 3
I am using 4.1 since February. In my installation there is no setting key named sevenspikescommonsettings.lazyloadimages. When i add manually there is no difference.


I just download 4.2 theme. I searched this setting key and nothing.
I searched also emporiumthemesettings.lazyloadimages key and i found one usage at .\Emporium\Views\Shared\_ProductBox.cshtml

like this:

var lazyLoadImages = settingService.GetSettingByKey("EmporiumThemeSettings.LazyLoadImages", false, storeId, true);


Similar code is in 4.1 version. May be i am missing something but also there will be a bug in there. Because when i switched this setting something happening: dissapper all images???
Boyko
2 months ago
#15851 Quote
Avatar
  • Moderator
  • 1437
adca wrote:
I am using 4.1 since February. In my installation there is no setting key named sevenspikescommonsettings.lazyloadimages. When i add manually there is no difference.


I just download 4.2 theme. I searched this setting key and nothing.
I searched also emporiumthemesettings.lazyloadimages key and i found one usage at .\Emporium\Views\Shared\_ProductBox.cshtml

like this:

var lazyLoadImages = settingService.GetSettingByKey("EmporiumThemeSettings.LazyLoadImages", false, storeId, true);


Similar code is in 4.1 version. May be i am missing something but also there will be a bug in there. Because when i switched this setting something happening: dissapper all images???


Hi adca,

In the version of February, even though you have the setting in the view the code that does the lazy loading is missing (the javascript is missing in the theme). That is why when you enable this setting it does not work. So please don't enable it as the images will disappear.

We planned to have theme specific settings initially but then decided to do it as a general setting that will be automatically enabled and used in all themes and plugins so that you don't need to set any settings manually.
This is how the latest version of Emporium theme in 4.1 and 4.2 works.
The code for the theme specific setting in Emporium in 4.20 is there but not really used and we will remove it (sorry for the confusion).

Simply update the theme to the latest version in 4.1 (even better if you simply upgrade to 4.20) and everything will work fine just like in our demo store.
Regards,
Boyko Stanev
Nop-Templates.com