• Resolved sneaky15

    (@larissaf15)


    Is there a function to display From $XX.XX rather than a price range for the wholesale price?

    Currently I have my Woocommerce store set to display From price rather than a price range using the below code.

    /* Edit WooCommerce Variable Product Price Range $$$-$$$ – Print “From: $$” Instead */
    add_filter( ‘woocommerce_variable_price_html’, ‘bbloomer_variation_price_format’, 10, 2 );

    function bbloomer_variation_price_format( $price, $product ) {

    // 1. Get min/max regular and sale variation prices

    $min_var_reg_price = $product->get_variation_regular_price( ‘min’, true );
    $min_var_sale_price = $product->get_variation_sale_price( ‘min’, true );
    $max_var_reg_price = $product->get_variation_regular_price( ‘max’, true );
    $max_var_sale_price = $product->get_variation_sale_price( ‘max’, true );

    // 2. New $price, unless all variations have exact same prices

    if ( ! ( $min_var_reg_price == $max_var_reg_price && $min_var_sale_price == $max_var_sale_price ) ) {
    if ( $min_var_sale_price < $min_var_reg_price ) {
    $price = sprintf( __( ‘From: %1$s%2$s‘, ‘woocommerce’ ), wc_price( $min_var_reg_price ), wc_price( $min_var_sale_price ) );
    } else {
    $price = sprintf( __( ‘From: %1$s’, ‘woocommerce’ ), wc_price( $min_var_reg_price ) );
    }
    }

    // 3. Return $price

    return $price;
    }

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

Viewing 1 replies (of 1 total)
  • Hi @larissaf15,

    Thanks for getting in touch with us!

    For our free version, unfortunately, we don’t have a feature to change the wholesale price display of variable products on the product page.

    This feature is a part of our Premium version which allows you to easily set the Variation display from price range, from minimum price or to the maximum price. https://snipboard.io/GrBn2t.jpg

    In addition, you’ll also get more features for your Wholesale store when you purchase WooCommerce Wholesale Prices Premium. Here’s the list of our features for reference:
    https://wholesalesuiteplugin.com/woocommerce-wholesale-prices-premium/

    I hope this helps! Let me know if you have any further questions.

    Best regards,

Viewing 1 replies (of 1 total)

The topic ‘Display From $XX.XX’ is closed to new replies.