From 7f4c20af76f6a3eaf9f1a6168b6525433010e31f Mon Sep 17 00:00:00 2001 From: Mohammed Saimon Date: Fri, 11 May 2018 07:59:34 +0600 Subject: [PATCH] fix(total_sales_count): the total sales for each product calculates twice when purchased from multiple vendor is fixed #249 (#250) --- includes/class-order-manager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-order-manager.php b/includes/class-order-manager.php index 574639402e..55611205bc 100644 --- a/includes/class-order-manager.php +++ b/includes/class-order-manager.php @@ -209,6 +209,9 @@ function create_sub_order( $parent_order, $seller_id, $seller_products ) { if ( $order_id && !is_wp_error( $order_id ) ) { + // update total_sales count for sub-order + wc_update_total_sales_counts( $order_id ); + // update author as vendor wp_update_post( array( 'post_author' => $seller_id,