Advertisement
verygoodplugins

Untitled

Oct 15th, 2024
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. function wpf_sync_shipping_email( $customer_data, $order ) {
  2.  
  3.     if ( ! $order->get_user_id() ) {
  4.         $customer_data['user_email']    = $customer_data['shipping_email'];
  5.         $customer_data['billing_email'] = $customer_data['shipping_email'];
  6.     }
  7.  
  8.     return $customer_data;
  9.  
  10. }
  11.  
  12. add_filter( 'wpf_woocommerce_customer_data', 'wpf_sync_shipping_email', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement