From d5f1472e75cc796eb19f36efec85f947ea81509b Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 23 Nov 2016 13:11:51 +0000 Subject: [PATCH] Set parent --- includes/abstracts/abstract-wc-order.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/abstracts/abstract-wc-order.php b/includes/abstracts/abstract-wc-order.php index 5e940a13f33..fe0544b6c99 100644 --- a/includes/abstracts/abstract-wc-order.php +++ b/includes/abstracts/abstract-wc-order.php @@ -829,6 +829,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order { $this->items[ $items_key ] = $this->get_items( $item->get_type() ); } + // Set parent. + $item->set_order_id( $this->get_id() ); + // Append new row with generated temporary ID if ( $item->get_id() ) { $this->items[ $items_key ][ $item->get_id() ] = $item;