Woocommerce Split payment method for vendors

I’m working on a WordPress theme with woocommerce multivendor functionality. Here vendors can upload product from frontend with all necessary details such as product details, payment details etc. What I would like to do is to split the payment for seller(vendor) and store owner(admin). Like if the product is $100, $5 goes to the admin’s paypal account. Below I have the Single account payment code. Please help.

$paypal_args = apply_filters( 'woocommerce_paypal_args', $paypal_args );
// Hook in
add_filter( 'woocommerce_paypal_args' , 'custom_override_paypal_email' );

// Our hooked in function is passed via the filter!
function custom_override_paypal_email( $paypal_args ) {
  $paypal_args['business'] = 'info@ocweb.pro';
  print_r( $paypal_args['business'] );
  return $paypal_args;
}

Related posts

Leave a Reply