Advertisement
verygoodplugins

Untitled

Jul 22nd, 2019
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement