-2

I am aadding text to Woocommerce customer-processing email like this:

if ( 'bacs' == $order->get_payment_method() )    {
    echo "Text A";
}
elseif ( 'paypal' == $order->get_payment_method() )    {
    echo "Text B";
}
else { 
    echo "Text C";
}

No I need to add credit card to have Text B as well. How can I add this inside the elseif statement?

hara55
  • 67
  • 5

1 Answers1

1

You can use the || (or) logical operator:

$payment_method = $order->get_payment_method();

if ( 'bacs' == $payment_method ) {
    echo "Text A";
} elseif ( 'paypal' == $payment_method || 'stripe' == $payment_method ) {
    echo "Text B";
} else { 
    echo "Text C";
}
Terminator-Barbapapa
  • 3,063
  • 2
  • 5
  • 16