Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Different text for different order emails

$
0
0

Replies: 1

Hello

How to insert different text on invoice depending on order email template (or by email status) with free plugin version if possible?
For example: put ‘text 1’ on the invoice if it’s Processing order email template, and put ‘text 2’ on the invoice if it’s a Cancelled order email template/status. Also to change the filename depending on these two.

I’ve tried something like

add_action( 'wpo_wcpdf_after_order_data', 'insert_text', 10, 2 );
function insert_text( $template_type, $order ) {
	if ( $order->get_status() == 'cancelled' && $template_type == 'invoice' ) {
		?>
		<p>text2</p>
		<?php
	}
}

but didn’t work


Viewing all articles
Browse latest Browse all 59525

Trending Articles