Fixed coding styles

This commit is contained in:
Cesar Rodas 2017-05-23 19:18:31 -04:00
parent 7f357b18ba
commit b612bab38b
2 changed files with 4 additions and 4 deletions

View File

@ -802,12 +802,12 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
// The item was not found in memory, we load in memory all the items related to this order
$types = $this->data_store->get_order_item_types( $this );
foreach ( $types as $type ) {
if ( !( $group = $this->type_to_group( $type ) ) || ! empty( $this->items[ $group ] ) ) {
if ( ! ( $group = $this->type_to_group( $type ) ) || ! empty( $this->items[ $group ] ) ) {
continue;
}
$this->items[ $group ] = $this->data_store->read_items( $this, $type );
if ( ! empty( $this->items[$group][ $item_id ] ) ) {
return $this->items[$group][ $item_id ];
if ( ! empty( $this->items[ $group ][ $item_id ] ) ) {
return $this->items[ $group ][ $item_id ];
}
}

View File

@ -362,7 +362,7 @@ abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP impleme
*/
public function get_order_item_types( WC_Order $order ) {
global $wpdb;
$query = $wpdb->prepare( "SELECT DISTINCT order_item_type FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d", $order->get_id() );
$query = $wpdb->prepare( "SELECT DISTINCT order_item_type FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d", $order->get_id() );
return wp_list_pluck( $wpdb->get_results( $query ), 'order_item_type' );
}
}