• Resolved mitchellk

    (@mitchellk)


    Hi there

    I want to override your plugin displaying the price range for variable products on the main product catalog. I only want to display the lowest price.

    > From: $LowestPrice

    In an older support topic you referred someone to some code snippets on Gist
    https://www.ads-software.com/support/topic/display-lowest-price/

    But those snippets do not work with your latest version.

    Please can you assist with the correct actions to apply or help with a modified version of the code mentioned in the above post.

    Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mitchellk

    (@mitchellk)

    Never mind I got it working with my original code which got disabled because I had selected the option “Suppress third party discount plugins”

    The code below fixes this on the Catalog page.

    add_filter( 'woocommerce_variable_sale_price_html', 'wpm_variation_price_format', 10, 2 );
    add_filter( 'woocommerce_variable_price_html', 'wpm_variation_price_format', 10, 2 );
    
    function wpm_variation_price_format( $price, $product ) {
    $min_price = $product->get_variation_price( 'min', true );
    $max_price = $product->get_variation_price( 'max', true );
    
    if ($min_price != $max_price){
    $price = sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $min_price ) );
    return $price;
    
    } else {
    $price = sprintf( __( '%1$s', 'woocommerce' ), wc_price( $min_price ) );
    return $price;
    }
    }

    Happy that you got it working @mitchellk .

    Feel free to reach us out in case of any further queries.

    Thanks
    Team Flycart

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable Price Range on Main Product Catalog’ is closed to new replies.