Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

View Categories

Commission Modifictaion for COD

Show commission as 0 for cash on delivery order #

If a buyer want to pay on the delivery, the marketplace admin, won’t have a new commission to pay as the whole payment process will be offline and there is no control over it.

So, you may set the commission amount 0 for this, using the below code

add_action( 'mvx_commission_after_save_commission_total', 'zero_commission' );
function zero_commission( $commission_id ) {
    $order_id = get_post_meta( $commission_id, '_commission_order_id', true );
    $order = wc_get_order($order_id);
    $payment = $order->get_meta( '_payment_method', true );
    if( $payment == 'cod' ) {
        update_post_meta( $commission_id, '_commission_amount', 0 );
        update_post_meta( $commission_id, '_commission_total', 0 );
    }
}

Exclude commission for offline payment #

If a customer chooses to pay COD. The money will not be going through admin, so it might be useful to exclude the commission for vendor. For this add this code in the function.php of the theme :

// paid commission automaticly for cod payment 
add_action( 'after_wcmp_calculate_commission', function( $commission_id, $vendor_order_id ) 
{ 
$payemnt_method = get_post_meta( $vendor_order_id , '_payment_method' , true ); if( $payemnt_method == 'cod' ) {
update_post_meta( $commission_id , '_paid_status' , 'paid' ); 
} 
},10,2);

Leave a Reply

Shopping Cart
Scroll to Top