total_sales for product_variation always “0”
-
Hi there,
I am trying to get the total_sales to display on the product page.
For simple products, I am able to achieve this, but for products with variations, the total_sales is always “0”.I am unsure if this is a problem with how I am getting the variation data or this is a bug.
The below is how I am retrieving the variation data:
$variation_obj = new WC_Product_variation($variation_id); //store variations in a new object $units_sold_variation = $variation_obj->get_total_sales(); //get units sold for variation
Can you please assist?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘total_sales for product_variation always “0”’ is closed to new replies.