Ad

Anyway To Change The Total Title From The WooCommerce Order Received Page's Order Overview

Is there a hook to change the Total title from the WooCommerce order received page's order overview? Please see the below image to understand better

Ad

Answer

Yes, you can use the gettext WordPress filter to "translate" (rename in your case) that string of text.

Your string is inside the thankyou.php WooCommerce template:

esc_html_e( 'Total:', 'woocommerce' );

Based on WooCommerce: How to Translate / Rename Any String tutorial, the right code should be the following:

add_filter( 'gettext', 'bbloomer_translate_woocommerce_strings', 9999, 3 );
  
function bbloomer_translate_woocommerce_strings( $translated, $untranslated, $domain ) {
   if ( ! is_admin() && 'woocommerce' === $domain ) {
      switch ( $translated ) {
         case 'Total:':
            $translated = 'Whatever:';
            break;
      }
   }   
   return $translated;
}
Ad
source: stackoverflow.com
Ad