Skip to content

dokan_get_earning_by_order doesn't work anymore in 4.0 #2722

@dan504301

Description

@dan504301

Bug Description

Starting with Dokan 4.0 the dokan_get_earning_by_order hook doesn't work anymore.

This hook was fine until 4.0 and I could include the order fees in the vendor earning.

This should be added in the admin dashboard as a toggle!

My usage, this code was provided by a Dokan developer long time ago, and now (under 4.0) does't work anymore.

add_filter( 'dokan_get_earning_by_order', function( $earning, $order, $context ) {
    if ( $context === dokan()->commission->get_tax_fee_recipient( $order->get_id() ) ) {
        $fees = $order->get_total_fees(); // Get the total fees for the order
        $earning += $fees;
    }

    return $earning;
}, 10, 3 );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions