laciikee

ZRUŠENA OBJEDNAVKA EMAIL WOOCOMMERCE

Jan 30th, 2023 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. function wc_cancelled_order_add_customer_email( $recipient, $order ) {
  2.     // Check if $order is null
  3.     if ( is_a( $order, 'WC_Order' ) && ! is_null( $order->billing_email ) ) {
  4.         // Append the billing email to the recipient list
  5.         return $recipient . ',' . $order->billing_email;
  6.     }
  7.  
  8.     // If $order is null or billing_email is null, return the original recipient
  9.     return $recipient;
  10. }
  11.  
  12. add_filter( 'woocommerce_email_recipient_cancelled_order', 'wc_cancelled_order_add_customer_email', 10, 2 );
  13.  
Advertisement
Add Comment
Please, Sign In to add comment