• Customer

    hide the price of the lowest variable

    Posted by: creoadv May 14, 2021 at 10:01 (4 year ago)
    Hi there,
    how can I hide the price of the lowest variable, once I have selected the variable that interests me?
    Let me explain better with a screenshot.

    I have add this on function.php to Hide Price Range for WooCommerce Variable Products


    // MODIFICA ALISA Show only lowest prices in WooCommerce variable products

    //Hide Price Range for WooCommerce Variable Products
    add_filter( 'woocommerce_variable_sale_price_html',
    'lw_variable_product_price', 10, 2 );
    add_filter( 'woocommerce_variable_price_html',
    'lw_variable_product_price', 10, 2 );

    function lw_variable_product_price( $v_price, $v_product ) {

    // Product Price
    $prod_prices = array( $v_product->get_variation_price( 'min', true ),
    $v_product->get_variation_price( 'max', true ) );
    $prod_price = $prod_prices[0]!==$prod_prices[1] ? sprintf(__(' %1$s', 'woocommerce'),
    wc_price( $prod_prices[0] ) ) : wc_price( $prod_prices[0] );

    // Regular Price
    $regular_prices = array( $v_product->get_variation_regular_price( 'min', true ),
    $v_product->get_variation_regular_price( 'max', true ) );
    sort( $regular_prices );
    $regular_price = $regular_prices[0]!==$regular_prices[1] ? sprintf(__(' %1$s','woocommerce')
    , wc_price( $regular_prices[0] ) ) : wc_price( $regular_prices[0] );

    if ( $prod_price !== $regular_price ) {
    $prod_price = ''.$regular_price.$v_product->get_price_suffix() . ' ' .
    $prod_price . $v_product->get_price_suffix() . '';
    }
    return $prod_price;
    }



    BEST REGARDS

  • Customer

    Posted by: Maason, May 14, 2021 at 13:45 (4 year ago)

    Hi creoadv
    In this case then you have to customize by yourself or connect to customize services, they will check and help you. We are really sorry because weo do not support for customize work. Hope you understand us.
    Regards
  • Customer

    Posted by: creoadv, May 17, 2021 at 06:49 (4 year ago)

    ok
  • Customer

    Posted by: Maason, May 17, 2021 at 08:26 (4 year ago)

    Thanks

INSTALLATION SERVICE

Theme Installation: $49. Pay now

CUSTOMIZED SERVICES

Use our expert service to turn your ideas into reality. Please send an email to kutethemes@gmail.com to provide the more detailed information. Thanks!

WORKING TIME

Our support service works from Monday to Friday.
Mean time (GMT +7):
+ 7:30 - 11:30 AM
+ 1:30 - 5:30 PM
We will try to answer all the questions within 24 hours and solve them as quickly as possible