Advertisement
verygoodplugins

Untitled

Jun 17th, 2019
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. function add_payout_field( $meta_fields ) {
  2.  
  3.     $meta_fields['payout'] = array( 'label' => 'Stripe Payout', 'group' => 'woocommerce' );
  4.     $meta_fields['pp_payout'] = array( 'label' => 'PayPal Payout', 'group' => 'woocommerce' );
  5.  
  6.     return $meta_fields;
  7.  
  8. }
  9.  
  10. add_filter( 'wpf_meta_fields', 'add_payout_field', 10 );
  11.  
  12. function get_payout_data( $order_data, $order ) {
  13.  
  14.     $order_data['payout'] = get_post_meta( $order->get_id(), '_stripe_net', true );
  15.     $order_data['pp_payout'] = get_post_meta( $order->get_id(), '_paypal_net', true );
  16.  
  17.     return $order_data;
  18.  
  19. }
  20.  
  21. add_filter( 'wpf_woocommerce_customer_data', 'get_payout_data', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement