• Hello!

    I would like to remove the “from” price prefix on my single product pages altogether and keep it everywhere else the products appear (widgets, shop page, etc)

    I’ve been scouring the forums but couldn’t find a clear answer. Can you help?

    Thank you

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nicola Mustone

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello there, you can find a snippet for this here: https://gist.github.com/BFTrick/7643587

    The “From” is not included in WooCommerce anymore and it’s only present in very old versions of it, or if the theme customizes the string to include it again.

    Thread Starter screamingredeagle

    (@screamingredeagle)

    Well I’m using elementor pro and woocommerce. So I’ve already added a snippet to remove the price range on 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(__(‘From: %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(__(‘From: %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;
    }

    This worked to eliminate the price range but then I was stuck with the prefix “from”. I added the snippet you shared but then the price was eliminated from everywhere on the site. So I’m assuming there’s a conflict somewhere?

    Sorry I’m a newb.

    Thanks for your help

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove “from”’ is closed to new replies.