Woocommerce Booking and Dokan - Get Earnings Value

138 Views Asked by At

Woocommerce Bookings has two pages which are displayed to users who manage bookings.

  1. Booking Details Page
  2. Order Details Page.

The Bookings Details Page does not display the price of the booking but rather the details such as duration, start/end date and status.

The order details page shows the price of the booking, the status, quantity etc;

I am trying to bring some of the "order details" fields across to the "Booking Details Page". Once such item is the "Earnings from Order" field which is essentially the [booking cost * 0.82].

The code I am trying to use is the following:

<li class="earning-from-order">
<span><?php esc_html_e( 'Earning From Order:', 'dokan-lite' ); ?></span>
<?php echo wp_kses_post( wc_price( dokan()->commission->get_earning_by_order( $order ) ) ); ?>
</li>

The value that is outputted is $1.00 which is incorrect.

An example value for earning should be [Booking Cost $40 000] & Earnings [$33 000] I need to show the Earnings amount.

0

There are 0 best solutions below