Set parent

This commit is contained in:
Mike Jolley 2016-11-23 13:11:51 +00:00
parent 1c9c26cda6
commit 2b1c762142
1 changed files with 3 additions and 0 deletions

View File

@ -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;