Tagged: , ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25176

    In a variable product I have the possibility to offer only one product, but the ballon appear in all products. How I can do?

    Thanks in advanced.

    #126038

    I found a solution, at the moment, I added the code in /plugins/woocommerce/assets/js/frontend/single-product.min.js

    if($('.single_variation').children('.price').children('ins').length==0)e('span.onsale').addClass('oculto'); // hide bubble when product is not on sale

    $('form.cart select').change(function() {
    setTimeout(function() {
    if ($('.single_variation').children('.price').children('ins').length == 0) {
    $oferta = true;
    } else {
    $oferta = false;
    }
    $('span.onsale').toggleClass('oculto', $oferta);
    }, 500); // setTimeout, because the element takes a moment to appear

    });

    I´m not an expert :) Only tested whit one attribute, but I guess that works too.

    PS: Sorry for my english

    #126039

    Hi!

    Glad you solved the problem :)

    Best regards,

    Peter

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

The topic ‘Hide Sale! bubble in variable product when one of this products is not on sale’ is closed to new replies.