Method 2

1: Admin Setup Payout Method

From Menu left panel click Payout Method >> New

The vendor will see that payout method in Profile

2: The Vendor: withdraw amount from his account

3: The Admin will see requirement withdraw of vendor in Payout menu

The admin can update payout with status: Completed, Canceled, Pending

4: Update Calculate Profit for Vendor

You can use filter hook: 'el_get_profit_id_booking' to 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;
	
}

Last updated