I am trying to add other content to the completed woocommerce email order notifications based on combinations of payment methods and delivery method.
My code is:
function my_completed_order_email_instructions( $order, $sent_to_admin, $plain_text, $email ) {
if (( get_post_meta($order->id, '_payment_method', true) == 'cod' ) && ( get_post_meta($order->id, '_shipping_method', true) == 'local pickup' )){
echo "something1";
}
elseif (( get_post_meta($order->id, '_payment_method', true) == 'bacs' ) && ( get_post_meta($order->id, '_shipping_method', true) == 'local pickup' )){
echo "something2";
}
else {
echo "something3";
}}
The payment part works (I get the right "something1" to "something3"), but if I add the && delivery status, I get "something3" with each payment method.
Any idea what is wrong and how can I make it work?
thank
source
share