Skip to content

Instantly share code, notes, and snippets.

@spasicm
Created October 5, 2021 10:17
Show Gist options
  • Save spasicm/c13aaa3a4208d7d66031b786579feb29 to your computer and use it in GitHub Desktop.
Save spasicm/c13aaa3a4208d7d66031b786579feb29 to your computer and use it in GitHub Desktop.
Woocommerce append a text to total price on the "Cart", "Check out", "Thank you" pages & "Order recived" email
<?php
// This code should be added to your WordPress child theme functions.php
// Woocommerce append a text to total price on the "Cart" & "Check out" page
add_filter( 'woocommerce_cart_totals_order_total_html', 'eworkshop_custom_total_message_html', 10, 1 );
function eworkshop_custom_total_message_html( $value ) {
$value .= __('<br>some custom TXT') . '<br>';
return $value;
}
// Woocommerce append a text to total price on the "Thank you" page & "Order recived" email
add_filter( 'woocommerce_get_formatted_order_total', 'eworkshop_custom_order_total_message_html', 10, 1 );
function eworkshop_custom_order_total_message_html( $total ) {
$total .= __('<br>some custom TXT') . '<br>';
return $total;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment