I am developing a booking system in which the client wants only to take a USD 50 deposit and to negotiate the remaining amount separately. In order to achieve this I have used the following code to update the total price to USD 50 and to show the remaining price.
function prefix_add_discount_line( $cart ) {
$deposit = 50;
$remaining = $cart->subtotal - 50;
$cart->add_fee( __( 'Amount Remaining', 'remaining' ) , -$remaining);
}
add_action( 'woocommerce_cart_calculate_fees', 'prefix_add_discount_line' );
In the order emails the remaining amount is displayed with a minus(-) symbol. Please let me know how to remove the minus symbol in the woocommerce order emails
2
Answers
To make all negative fees amounts to be displayed as a positive amount on WooCommerce Orders totals rows, use the following:
Now to make that only for WooCommerce email notifications, use instead this:
Code goes in functions.php file of the active child theme (or active theme). Tested and works.
The other answer didn’t work for me.