How to turn off the display " – max price" in the variable product

Solved6 replies3 participantsUpdated by Brian Johnson

  • Avatar: conitex
    conitex
    Participant

    actual variable product ” min – max price ”
    turn off display “-max price” in single product and category product

    or you can change the custom.css or functions.php
    that displayed the only “min” in variable product

    6 Answers

    Avatar: Brian Johnson
    Brian Johnson
    Member

    Hello

    1.Please provide us with the link to your site.
    2. Do you want to hide max price value?

    With best regards
    Brian Johnson

    Avatar: conitex
    conitex
    Participant

    yes

    hide ” – max price” in the variable product

    only display “min price

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Participant

    Hello,

    Sorry for inconvenience but this is Woocommerce configuration and you have to contact their support team.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: Brian Johnson
    Brian Johnson
    Member

    You may try to add following code into the custom.css:

    .price {color:transparent!important}
    .price .amount{color:red!important;}
    .price :nth-child(2) {display:none}

    With best regards
    Brian Johnson

    Avatar: conitex
    conitex
    Participant

    work change function.php
    <?php
    define(‘ETHEME_DOMAIN’, ‘legenda’);
    require_once( get_template_directory() . ‘/framework/init.php’ );

    add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2);
    function custom_variation_price( $price, $product ) {
    $price = ”;
    if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= ‘<span class=”from”>’ . _x(‘from’, ‘min_price’, ‘woocommerce’) . ‘ </span>’;
    $price .= woocommerce_price($product->min_variation_price);
    return $price;
    }

    or

    <?php
    define(‘ETHEME_DOMAIN’, ‘legenda’);
    require_once( get_template_directory() . ‘/framework/init.php’ );

    add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2);
    function custom_variation_price( $price, $product ) {
    $price = ”;
    if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= ‘<span class=”from”>’ . _x(‘ ‘, ‘min_price’, ‘woocommerce’) . ‘ </span>’;
    $price .= woocommerce_price($product->min_variation_price);
    return $price;
    }

    Avatar: Brian Johnson
    Brian Johnson
    Member

    We are glad that you have managed to find the solution.

    With best regards
    Brian Johnson

The issue related to '‘how to turn off the display " – max price" in the variable product’' has been successfully resolved, and the topic is now closed for further responses