I’m trying to change the on-hold email to include the order number in the introduction.
I’ve added "$order->get_id()" to show the order number. Not quite working. Any ideas?
<p><?php esc_html_e( 'Thanks for your order. Your order number is $order->get_id(). Below you can find the contents of your order.', 'woocommerce' ); ?></p>
2
Answers
This is because it is now seen as part of the string, it’s missing the concatenation operator
('.')
More info: String Operators
Use it like this instead
Example:
Not
But
EDIT
Another option: see Loic’s answer,
double answer, posted simultaneously
You need to concatenate the order number in the string… You can use, in a better way,
printf()
and theWC_Order
methodget_order_number()
as follows: