• Hi there,

    I have realized that the value returned from $product->get_total_sales() is different from the values shown when viewing sales per product reports (WooCommerce > Reports > Sales by product). As such, some products are returning zero sales while their reports show they have been sold multiple times.

    Can you confirm why this is the case please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    This isn’t something I can replicate on my side; Can you share a bit more information on what you’re seeing on your side? If you have screenshots to share, that’d be great ??

    Thanks!

    Thread Starter jorpdesigns

    (@jorpdesigns)

    Hi,

    Here is a screenshot from the WooCommerce Reports page for a particular product: https://prnt.sc/te6z5j

    Here is a screenshot showing the sales number for the same product (added via hook): https://prnt.sc/te6yj6

    Code used:
    global $product;
    $units_sold = $product->get_total_sales();
    echo ‘<p>’ . sprintf( __( ‘Units Sold: %s’, ‘woocommerce’ ), $units_sold ) . ‘</p>’;

    Thread Starter jorpdesigns

    (@jorpdesigns)

    Hi, any update?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘$product->get_total_sales() not correct’ is closed to new replies.