Skip to content

Commit

Permalink
fix: dokan_get_seller_id_by_order function (#359)
Browse files Browse the repository at this point in the history
* fix: dokan_get_seller_id_by_order function

* fix: use correct function

* refactor: dokan_get_seller_id_by_order function
  • Loading branch information
saimonh3 authored and sabbir1991 committed Sep 3, 2018
1 parent 04b9114 commit dd32c80
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions includes/order-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,18 +391,8 @@ function dokan_get_seller_id_by_order( $order_id ) {
wp_cache_set( $cache_key, $sellers, $cache_group );
}

if ( count( $sellers ) > 1 ) {
foreach ( $sellers as $seller ) {
$seller_id[] = (int) $seller->seller_id;
}

return $seller_id;

} else if ( count( $sellers ) == 1 ) {

$seller_id = reset( $sellers )->seller_id;

return $seller_id;
if ( count( $sellers ) == 1 ) {
return reset( $sellers )->seller_id;
}

return 0;
Expand Down

0 comments on commit dd32c80

Please sign in to comment.