Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @gomez1986 Yeah sure

    The file directory is the following: assets/js/woo-linked-variation-frontend.js

    And the code including my customization is the following:

    (function ($) {
        "use strict";
        jQuery(document).ready(function () {
    
            // linked variation label change on hover 
            
            
            $(function () {
                var wooLinkedVariation = $('.woo-linked-variation');
                var currentVariation = wooLinkedVariation.find('.linked-variation-label .variation-selection');
                var singleVariation = wooLinkedVariation.find('.linked-variations ul li');
        
    $('li').filter(function(){
        return $.trim($(this).html()) == '';
    }).hide();
                singleVariation.hover(function () {
                    var thisDataVariant = $(this).data('variant');
                    $(this).parents('.woo-linked-variation').find('.linked-variation-label .variation-selection').html(thisDataVariant);
                }, function () {
                    $(this).parents('.woo-linked-variation').find('.linked-variation-label .variation-selection').html(currentVariation.data('variant'));
                });
            });
    
        });
        
        
        
    })(jQuery);

    I solved it.
    Just add:

    $(‘li’).filter(function(){
    return $.trim($(this).html()) == ”;
    }).hide();

    after the first three vars in woo-linked-variation-frontend.js

    This worked prefect for me.

    Hi @raazon great plugin!
    Sadly I’m facing the same issue with the empty li’s

    I tried adding the following code in “woo-linked-variation-frontend.js”
    but it didn’t work.

    jQuery(document).ready(function($) {
    $(‘ul’).find(‘li’).each(function () {
    if ($.trim($(this).text()) == ” “) {
    $(this).remove();
    }
    })
    });

    Maybe i did sth wrong, maybe I used the wrong file, I’m not sure, still learning Jquery.

    Hope you’ll fix it soon.

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