Skip to content

Commit

Permalink
fix: Commission priority sequence (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohaiminulislam1989 authored and sabbir1991 committed Apr 16, 2018
1 parent 4910c7e commit 5a302fd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@ function dokan_get_seller_percentage( $seller_id = 0, $product_id = 0 ) {
$commission_val = (float) ( 100 - $global_percentage );
}

//seller wise percentage
if ( $seller_id ) {
$admin_commission = get_user_meta( $seller_id, 'dokan_admin_percentage', true );

if ( is_numeric( $admin_commission ) && $admin_commission >= 0 && $admin_commission <= 100 ) {
$commission_val = (float) ( 100 - $admin_commission );
}
}

//product wise percentage
if ( $product_id ) {
$category_commission = dokan_get_category_wise_seller_commission( $product_id );
Expand All @@ -442,15 +451,6 @@ function dokan_get_seller_percentage( $seller_id = 0, $product_id = 0 ) {
}
}

//seller wise percentage
if ( $seller_id ) {
$admin_commission = get_user_meta( $seller_id, 'dokan_admin_percentage', true );

if ( is_numeric( $admin_commission ) && $admin_commission >= 0 && $admin_commission <= 100 ) {
$commission_val = (float) ( 100 - $admin_commission );
}
}

return apply_filters( 'dokan_get_seller_percentage' , $commission_val, $seller_id, $product_id );
}

Expand Down

0 comments on commit 5a302fd

Please sign in to comment.