Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion includes/Order/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,29 @@ public function on_order_status_change( $order_id, $old_status, $new_status, $or
*/
$exclude_cod_payment = 'on' === dokan_get_option( 'exclude_cod_payment', 'dokan_withdraw', 'off' );

if ( $exclude_cod_payment && 'cod' === $order->get_payment_method() ) {
$should_exclude_cod_payment = $exclude_cod_payment && 'cod' === $order->get_payment_method();

/**
* Filter whether the order should be excluded from vendor withdrawal balance.
*
* @since DOKAN_SINCE
*
* @param bool $should_exclude_cod_payment Whether to exclude COD payment from balance.
* @param WC_Order $order Order object.
* @param int $order_id Order ID.
* @param string $new_status New order status.
* @param bool $exclude_cod_payment Whether exclude COD option is enabled.
*/
Comment thread
MdAsifHossainNadim marked this conversation as resolved.
$should_exclude_cod_payment = apply_filters(
'dokan_order_should_exclude_from_vendor_balance',
$should_exclude_cod_payment,
$order,
$order_id,
$new_status,
$exclude_cod_payment
);

if ( $should_exclude_cod_payment ) {
return;
}

Expand Down
Loading