kpanoutsos
Forum Replies Created
-
Forum: Plugins
In reply to: [Linked Variation for WooCommerce] empty variation li@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);
Forum: Plugins
In reply to: [Linked Variation for WooCommerce] empty variation liI 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.
Forum: Plugins
In reply to: [Linked Variation for WooCommerce] empty variation liHi @raazon great plugin!
Sadly I’m facing the same issue with the empty li’sI 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.