verygoodplugins

Untitled

Jun 24th, 2021
730
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function example_create_object( $order_id, $contact_id ) {
  2.  
  3.     $data = array(
  4.         'MyCustomField' => $order_id,
  5.     );
  6.  
  7.     $object_id = wp_fusion()->crm->add_object( $data, 'ObjectType' );
  8.  
  9.     if ( ! is_wp_error( $object_id ) ) {
  10.         update_post_meta( $order_id, 'salesforce_object_id', $object_id );
  11.     }
  12.  
  13. }
  14.  
  15. add_action( 'wpf_woocommerce_payment_complete', 'example_create_object', 10, 2 );
RAW Paste Data