Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wpf_ecommerce_activecampaign_add_deal', 'activecampaign_add_deal', 10, 2 );
- function activecampaign_add_deal( $data, $order_id ) {
- if ( is_product_type_in_order( $order_id, 'listing' ) ) {
- $item = get_order_item_listing_meta( $order_id );
- $data['pipeline'] = 1;
- $data['stage'] = 1;
- $data['title'] = $item['title'];
- $data['value'] = $item['commission'];
- }
- if ( is_product_type_in_order( $order_id, 'buyer' ) ) {
- $item = get_order_item_buyer_meta( $order_id );
- $data['pipeline'] = 2;
- $data['stage'] = 6;
- $data['title'] = $item['title'];
- $data['value'] = $item['commission'];
- }
- wp_fusion()->logger->handle( 'info', 0, 'Deal data:', array( 'meta_array_nofilter' => $data );
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement