WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Changing "From Price" to maximum price. (4 posts)

  1. morgyface
    Member
    Posted 1 year ago #

    Hello, clever people whom I will love forever if you can help me resolve this...

    Basically my clients site sells fabric by the meter. She also sells samples at a much cheaper price. This means that the product displays "From: Lower Price". I want it to display the maximum price.

    This bit of code nearly resolves this by displaying "From: min-price to max-price". Though all I need is the max-price bit.

    If anyone can help me fix this I will be so pleased I'll hug a pensioner and run down the street shouting about love.

    http://wordpress.org/extend/plugins/woocommerce/

  2. morgyface
    Member
    Posted 1 year ago #

    So a certain wonderful person has helped me resolve this. The following code needs adding to your themes function.php file.

    add_filter('woocommerce_variable_price_html', 
    
    'custom_variation_price', 10, 2);
    
    function custom_variation_price( $price, $product ) {
    
    $price = '';
    
    $price .= woocommerce_price($product->max_variation_price);
    
    return $price;
    }

    How wonderful.

  3. transphoners
    Member
    Posted 11 months ago #

    Thanks

  4. PMorgan
    Member
    Posted 11 months ago #

    thanks for sharing. )

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic