Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::get_refund_orders_join_clause
Returns a prepared SQL JOIN clause for finding refund orders belonging to a given parent order.
Overrides the CPT version to use the HPOS orders table.
Method of the class: OrdersTableDataStore{}
No Hooks.
Returns
String. Prepared SQL JOIN fragment.
Usage
// protected - for code of main (parent) or child class $result = $this->get_refund_orders_join_clause( $order_id ): string;
- $order_id(int) (required)
- Parent order ID.
Changelog
| Since 10.7.0 | Introduced. |
OrdersTableDataStore::get_refund_orders_join_clause() OrdersTableDataStore::get refund orders join clause code WC 10.7.0
protected function get_refund_orders_join_clause( int $order_id ): string {
global $wpdb;
return $wpdb->prepare( '%i AS refunds ON ( refunds.type = %s AND refunds.parent_order_id = %d )', self::get_orders_table_name(), 'shop_order_refund', $order_id );
}