From cc1992f1c8d1564d02bf7803b52443096221d747 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 16 Feb 2017 00:26:42 -0200 Subject: [PATCH] Fixed item variation_id --- includes/api/v1/class-wc-rest-orders-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/v1/class-wc-rest-orders-controller.php b/includes/api/v1/class-wc-rest-orders-controller.php index 4c5ee6386c3..f42f671539c 100644 --- a/includes/api/v1/class-wc-rest-orders-controller.php +++ b/includes/api/v1/class-wc-rest-orders-controller.php @@ -183,7 +183,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller { // Check if the product exists. if ( is_object( $product ) ) { $product_id = $product->get_id(); - $variation_id = $product->get_variation_id(); + $variation_id = $product->get_id() === $product->get_variation_id() ? 0 : $product->get_variation_id(); $product_sku = $product->get_sku(); }