Suggest new option !
-
Hello,
I modify your plugin because it cannot corresponding to my need, so i suggest to add this new option in your version.
This option will allow to not display all images where we have no variation selected. The aim is to display only image without associate variation when we load page OR when we clear variation selection.
Function to add in svi-frontend.js :
getImagesWithoutVariation: function () { var $items = []; jQuery.each(WOOSVIDATA.gallery.thumbs, function ($loop, v) { if (v.woosvi_slug == "") $items.push(v); }); if (WOOSVIDATA.gallery.main_image.woosvi_slug == "") $items.push(WOOSVIDATA.gallery.main_image); var $size = Object.keys($items).length; if ($size > 0) return $items; else return false; },Call to add in the same file but in the line 147 :
if(myOption==true){ var thumbs = WOOSVI.STARTS.getImagesWithoutVariation(); } else{ var thumbs = WOOSVIDATA.gallery.thumbs; } WOOSVI.STARTS.loadThumb(thumbs, false); WOOSVI.STARTS.reOrderThumbs();What do you think ?
Have a good day
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Suggest new option !’ is closed to new replies.