Skip to content

Commit

Permalink
fix: vendor earning not rendering for other types of product in vendo…
Browse files Browse the repository at this point in the history
…r dashboard
  • Loading branch information
sabbir1991 committed May 11, 2020
1 parent 459ab14 commit 3479301
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions includes/Vendor/Vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,10 @@ public function get_balance( $formatted = true, $on_date= '' ) {
}

if ( $formatted ) {
return apply_filters( 'dokan_get_formatted_seller_balance', wc_price( $earning ) );
return apply_filters( 'dokan_get_formatted_seller_balance', wc_price( $earning ), $this->id );
}

return apply_filters( 'dokan_get_seller_balance', $earning );
return apply_filters( 'dokan_get_seller_balance', $earning, $this->id );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions templates/products/products-listing-row.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
</td>
<td data-title="<?php esc_attr_e( 'Earning', 'dokan-lite' ); ?>">
<?php
if ( $product->get_type() == 'simple' ) {
$price = wc_price( dokan()->commission->get_earning_by_product( $product ) );
if ( $product->get_type() == 'variable' ) {
$price = dokan_get_variable_product_earning( $product->get_id() );
echo wp_kses( $price, $price_kses );
} else {
$price = dokan_get_variable_product_earning( $product->get_id() );
$price = wc_price( dokan()->commission->get_earning_by_product( $product ) );
echo wp_kses( $price, $price_kses );
}
?>
Expand Down

0 comments on commit 3479301

Please sign in to comment.