• Resolved dnox

    (@dnox)


    Hi, I’d like to. show the total amount of the order in the subject line.. {order_total}??? I’ve read some other threads from last year but was hoping to get the correct function code to be able to add it in please? Any help would be great thanks!!
    Dean

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @dnox ,

    This is an interesting idea.

    You can find all the available hooks to make changes to WooCommerce email subject lines here – Change email subject lines

    I have an example code to add additional information (order number in this case) with the default subject line. Add this code in your theme’s functions.php file or using a snippet plugin

    add_filter('woocommerce_email_subject_new_order', 'change_admin_email_subject', 1, 2);
    
    function change_admin_email_subject( $subject, $order ) {
    	global $woocommerce;
    
    	$order_total = $order->get_total();
    
    	$subject .= " " . "Order Total: " . $order_total;
    
    	return $subject;
    }

    I hope this helps.

    Thank you ??

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Total order amount in subject line’ is closed to new replies.