• 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)
  • Plugin Author RosendoLabs

    (@drosendo)

    Hey!
    Thanks for the feedback. In the initial version I had that 🙂

    But from the feedback I got most of the people still want images that have no variation to show (and I understand why).
    Some images may be general for all variations so they will show in the page load (hidden on variation choose).

    Example:
    Imagine a phone, you have several colors (variation), but then you have the wireframe frame (interior of phone is all the same) image that is not really a variation is just a general image of the product, so it will only show on the initial load.

    Did I explain my self?

    In your case you could just NOT upload the images that you are not going to use (image without associate variation), no?

    THanks,
    David

    Thread Starter alphonix

    (@alphonix)

    Sorry about my english, it may i didn’t explain it good.

    But i need to upload this image but not be appear without selection.

    Here you are my example :
    I have a “Mascara”, i have 3 differents colors: blue, green, black like variations.

    My main image is black. My gallery get common image “Mascara closed”.

    I don’t want show blue or green variation in the loading of page, and don’t want to select by default a color.

    I want only show Mascara blue or green if i click on the attribute not before because else i had too much pictures in the first loading and under the black version.

    But do as you want.

    Plugin Author RosendoLabs

    (@drosendo)

    the correct way would be to select a default color… and it would be fixed. But if you don’t want to set a default color, then yes, use your code. 🙂

    Thanks,
    David

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Suggest new option !’ is closed to new replies.