get_earning_by_product( $product, $context = ‘seller’, $price = null )

Description #

Get earning by product.

Parameters # 

$order

     (int|object) (Required) product id or product object (WC_Product).

$context

     (string) (Optional) context determines the whose product to retrieve. Default is ‘seller’.

$price 

     (float) (Optional) product price. Default is null.

Return #

    (float|null) earning of the user. Null on failure.

More information #

Usage #

$product = 67;

dokan()->commission->get_earning_by_product( $product );

Leave a Reply

Your email address will not be published. Required fields are marked *