Fix search order by customer billing phone or shipping phone
This commit is contained in:
parent
99fd4a1e09
commit
576d589b6b
|
@ -603,6 +603,16 @@ class WC_Order_Data_Store_CPT extends Abstract_WC_Order_Data_Store_CPT implement
|
|||
WHERE order_item_name LIKE %s",
|
||||
'%' . $wpdb->esc_like( wc_clean( $term ) ) . '%'
|
||||
)
|
||||
),
|
||||
$wpdb->get_col(
|
||||
$wpdb->prepare(
|
||||
"SELECT DISTINCT os.order_id FROM {$wpdb->prefix}wc_order_stats os
|
||||
INNER JOIN {$wpdb->prefix}wc_customer_lookup cl ON os.customer_id = cl.customer_id
|
||||
INNER JOIN {$wpdb->usermeta} um ON cl.user_id = um.user_id
|
||||
WHERE (um.meta_key = 'billing_phone' OR um.meta_key = 'shipping_phone')
|
||||
AND um.meta_value = %s",
|
||||
wc_clean( $term )
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue