• chbani06

    (@chbani06)


    Hello!!
    I use a custom code in my sotre to Replace Variable Price With Active Variation Price, while also hiding the variation price that appear under varations button.
    so it’s work fine ( the variation price changed when selected a variante ) in my single product page and also the quick view popup
    but when i use popup in archive page or a list of product in home page the variable price not changing.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter chbani06

    (@chbani06)

    this is the custom code:

    add_action( ‘woocommerce_variable_add_to_cart’, ‘bbloomer_update_price_with_variation_price’ );
    function bbloomer_update_price_with_variation_price() {
    global $product;
    $price = $product->get_price_html();
    wc_enqueue_js( “
    $(document).on(‘found_variation’, ‘form.cart’, function( event, variation ) {
    if(variation.price_html) $(‘.elementor-widget-container > p.price’).html(variation.price_html);
    $(‘.woocommerce-variation-price’).hide();
    });
    $(document).on(‘hide_variation’, ‘form.cart’, function( event, variation ) {
    $(‘.elementor-widget-container > p.price’).html(‘” . $price . “‘);
    });
    ” );
    }

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.