Last active
May 14, 2018 09:21
-
-
Save manchumahara/67d4e2da11a7b49b3f8a to your computer and use it in GitHub Desktop.
Adding Price in WooCommerce New Customer Order Email Subject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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