Advertisement
verygoodplugins

Untitled

Apr 16th, 2020
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. function add_address_to_note( $engagement_data, $order_id ) {
  2.  
  3.     $order      = wc_get_order( $order_id );
  4.     $order_data = $order->get_data();
  5.  
  6.     $new_text  = '<br /><br />Address:';
  7.     $new_text .= '<ul>';
  8.     $new_text .= '<li>Address 1 ' . $order_data['billing_address_1'] . '</li>';
  9.     $new_text .= '<li>Address 2 ' . $order_data['billing_address_2'] . '</li>';
  10.     $new_text .= '<li>City ' . $order_data['billing_city'] . '</li>';
  11.     $new_text .= '<li>State ' . $order_data['billing_state'] . '</li>';
  12.     $new_text .= '</ul>';
  13.  
  14.     $engagement_data['metadata']['body'] .= $new_text;
  15.  
  16.     return $engagement_data;
  17.  
  18. }
  19.  
  20. add_filter( 'wpf_ecommerce_hubspot_add_engagement', 'add_address_to_note', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement