Reinstate default value for $items
That was (accidentally?) removed with SHA: 877e39064
Fixes "PHP Notice: Undefined variable: items" when attempting to get
line items of a type that does not exist on the order, like coupons.
This commit is contained in:
parent
8bc5e9e284
commit
a826330ad0
|
@ -1126,6 +1126,7 @@ abstract class WC_Abstract_Order {
|
|||
$type = array( $type );
|
||||
}
|
||||
|
||||
$items = array();
|
||||
$get_items_sql = $wpdb->prepare( "SELECT order_item_id, order_item_name, order_item_type FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d ", $this->id );
|
||||
$get_items_sql .= "AND order_item_type IN ( '" . implode( "','", array_map( 'esc_sql', $type ) ) . "' ) ORDER BY order_item_id;";
|
||||
$line_items = $wpdb->get_results( $get_items_sql );
|
||||
|
|
Loading…
Reference in New Issue