17 Comments

  • Henny says:

    Thanks a lot for the code-snippets but in which php-file do I put them?

  • Camron says:

    Hi Terry, I have tried the snippet but it doesn’t work, any suggestions.

  • Mike says:

    It doesn’t work for me either :(.

    I put the above code in functions.php of my child theme, entered a sold out price for a product and nothing to see on the front end. I mean, sold out price is showed correctly but no info as shown on the screens above.

    I have a woocommerce dynamic pricing plugin but added to it a code that turns off the global discount rule on a given product when sold out price is given, so I hoped it will work then, but nothing.

  • Grout says:

    Hi Terry,
    Thanks for this tip.
    How can I add a class to this function please?

  • Hezekiah says:

    The code above works perfectly well but I need something more, I want to display total amount saved or percentage of amount saved on checkout page

  • Rose says:

    Hi Terry,

    Somehow the word “Save” does not show on the Home page but only the product page. For example, Home page products show Price $ and % Amount right next to it, no spacing in between but the product page shows Price $ Save % Amount – correctly.

    How do I add the “Save” and leave a space in between the Price and Save %? Here is the site.

    http://www.zenorganichealth.com.au

    Thank you,
    Rose

  • Gord says:

    How would you do this to variable products?

  • faegheh says:

    thank you very much!

  • KC CHeng says:

    Hi Terry,

    How do you change the font color and size? THanks

  • yaseen says:

    How to show percentage or saved amount for WooCommerce product sale price in checkout page

  • Mustafa says:

    Hi Terry,
    I was using this snippet in Woocommerce 2.3 and it worked well but with the current version of Wooccommerce 2.5 it doesn´t any more. Have you tried it on the recent version of Woocommerce?
    Thanks in advance!!

  • Ketan says:

    Hi Terry,

    Thanks for this tip. After adding your code total percentage discount is display on simple product page.

    But in Variable product percentage discount is not display. So please help me how to show percentage discount on Variable product page.

    I am waiting your replay.

    Thanks,
    Ketan.

  • Akif says:

    Hello. I want to add 3% in order total. Can you help me in this.
    function process_payment($order_id) {
    global $woocommerce;

    $order = new WC_Order($order_id);

    $totalamount = $order->calculate_totals();

    $website_url = home_url( ‘/’ );

    return array(
    ‘result’ => ‘success’,
    ‘redirect’ => ”.$website_url.’wc-api/WC_Gateway_Easypay?orderId=’.$order_id.’&amount=’.$totalamount
    );
    }

    Thanks.

  • Javid says:

    hi terry
    how can add class for this code :
    // Add save amount next to sale item prices.
    add_filter( ‘woocommerce_sale_price_html’, ‘woocommerce_custom_sales_price’, 10, 2 );
    function woocommerce_custom_sales_price( $price, $product ) {
    $saved = wc_price( $product->regular_price – $product->sale_price );
    return $price . sprintf( __(‘ Save %s’, ‘woocommerce’ ), $saved );
    }

    and only show in product page

    thank you

  • mounish says:

    how to display the regular price and sale price in checkout page woocommerce

  • toggy says:

    doesn’t work v3.0.1. please can you update page? thank for you!

Leave a Reply

Your email address will not be published. Required fields are marked *

WhatsApp chat Talk to Me