SHARE
TWEET

Untitled

verygoodplugins Jul 22nd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter( 'wpf_ecommerce_activecampaign_add_deal', 'activecampaign_add_deal', 10, 2 );
  2.  
  3. function activecampaign_add_deal( $data, $order_id ) {
  4.     if ( is_product_type_in_order( $order_id, 'listing' ) ) {
  5.         $item             = get_order_item_listing_meta( $order_id );
  6.         $data['pipeline'] = 1;
  7.         $data['stage']    = 1;
  8.         $data['title']    = $item['title'];
  9.         $data['value']    = $item['commission'];
  10.     }
  11.  
  12.     if ( is_product_type_in_order( $order_id, 'buyer' ) ) {
  13.         $item             = get_order_item_buyer_meta( $order_id );
  14.         $data['pipeline'] = 2;
  15.         $data['stage']    = 6;
  16.         $data['title']    = $item['title'];
  17.         $data['value']    = $item['commission'];
  18.     }
  19.  
  20.     wp_fusion()->logger->handle( 'info', 0, 'Deal data:', array( 'meta_array_nofilter' => $data );
  21.  
  22.     return $data;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top