order->get_items() as $item ) { if ( ! isset( $this->data['rows'][ $item->belongs_to ] ) ) { $this->data['rows'][ $item->belongs_to ] = array(); } if ( $item->is_line_item ) { // If form product item, we don't need to store pricing info, name and options as they are already stored. $exclude_properties = is_a( $item, GF_Form_Product_Item::class ) ? array( 'name', 'price', 'quantity', 'sub_total', 'options' ) : array(); $this->data['rows'][ $item->belongs_to ][] = $this->filter_item_data( $item, $exclude_properties ); } } // No need to save totals now as they will be calculated later. // In the future when we have dynamically calculated totals we may save them. unset( $this->data['totals'] ); // Versioning will help identify this when it changes later, which is very likely. $this->data['v'] = '0.1'; } }