diff --git a/tests/framework/helpers/class-wc-helper-order.php b/tests/framework/helpers/class-wc-helper-order.php index ce123d0cc7b..b0ab1d97b5b 100644 --- a/tests/framework/helpers/class-wc-helper-order.php +++ b/tests/framework/helpers/class-wc-helper-order.php @@ -57,7 +57,15 @@ class WC_Helper_Order { $order = wc_create_order( $order_data ); // Add order products - $order->add_product( $product, 4 ); + $item = new WC_Order_Item_Product(); + $item->set_props( array( + 'product' => $product, + 'quantity' => 4, + 'subtotal' => wc_get_price_excluding_tax( $product, array( 'qty' => 4 ) ), + 'total' => wc_get_price_excluding_tax( $product, array( 'qty' => 4 ) ), + ) ); + $item->save(); + $order->add_item( $item ); // Set billing address $order->set_billing_first_name( 'Jeroen' );