Home > Mobile >  Display price suffix in WooCommerce thankyou page and emails in functions.php
Display price suffix in WooCommerce thankyou page and emails in functions.php

Time:08-24

Is there a solution to add a suffix next to the price on the WooCommerce thankyou page and in all emails to customers/admins without copying the WooCommerce templates using a function (in e.g. functions.php)?

I have already used the following functions to change the price in the store and in the shopping cart/checkout:

add_filter( 'woocommerce_get_price_suffix', 'function_name', 999, 4 );   //  Archive page, Single product page
add_filter( 'woocommerce_cart_item_price', 'function_name', 10, 3 );     //  Cart item price
add_filter( 'woocommerce_cart_item_subtotal', 'function_name', 10, 3 );     //  Cart Item Subtotal
add_filter( 'woocommerce_cart_subtotal', 'function_name');    //  Cart Subtotal
add_filter( 'woocommerce_cart_total', 'function_name');   //  Cart Total

Thank you!

CodePudding user response:

You can filter woocommerce_order_formatted_line_subtotal like so:

add_filter( 'woocommerce_order_formatted_line_subtotal', 'BN_add_price_suffix_subtotal', 10, 3 );

function BN_add_price_suffix_subtotal( $subtotal ) {
    
    $suffix =' Suffix';
    return $subtotal . $suffix;
}
  • Related