Skip to content

Instantly share code, notes, and snippets.

@manchumahara
Last active May 14, 2018 09:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manchumahara/67d4e2da11a7b49b3f8a to your computer and use it in GitHub Desktop.
Save manchumahara/67d4e2da11a7b49b3f8a to your computer and use it in GitHub Desktop.
Adding Price in WooCommerce New Customer Order Email Subject
//woocommerce documentaiton http://docs.woothemes.com/document/change-email-subject-lines/
add_filter('woocommerce_email_subject_new_order', 'cbwoocommerce_neworder_email_subject', 1, 2);
/**
* @param $subject
* @param $order
*
* @return string
*/
function cbwoocommerce_neworder_email_subject( $subject, $order ) {
global $woocommerce;
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$currency = get_woocommerce_currency();
$order_total = $order->get_total() ;
$subject = sprintf( '[%s] New Customer Order (# %s) - %s ' , $blogname , $order->id , $currency.$order_total );
return $subject;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment