1: Admin Setup Payout Method
2: The Vendor: withdraw amount from his account
4: Update Calculate Profit for Vendor
// Some code
add_filter( 'el_get_profit_id_booking', 'get_profit_by_id_booking_customize', 10, 2 );
function get_profit_by_id_booking_customize ( $profit, $id_booking ) {
if ($id_booking == null) return ;
$id_event = get_post_meta( $id_booking, OVA_METABOX_EVENT . 'id_event', true );
$total_after_tax = get_post_meta( $id_booking, OVA_METABOX_EVENT . 'total_after_tax', true );
$total_before_tax = get_post_meta( $id_booking, OVA_METABOX_EVENT .'total', true );
$list_ticket_by_id_booking = EL_Ticket::instance()->get_list_ticket_by_id_booking($id_booking);
$number_ticket = count($list_ticket_by_id_booking);
$number_ticket_free = EL_Ticket::instance()->get_number_ticket_free_by_id_booking($id_booking);
$number_ticket_paid = $number_ticket - $number_ticket_free;
$total_admin = get_total_admin($id_event, $total_before_tax, $number_ticket_paid, $number_ticket_free);
$profit = $total_before_tax - $total_admin;
return $profit;
}