| @@ -75,9 +75,9 @@ | ||
| 75 | 75 | * @since 3.5.0 |
| 76 | 76 | */ |
| 77 | 77 | private function get_sql() { |
| 78 | 78 | global $wpdb; |
| 79 | - if ( class_exists( '\Automattic\WooCommerce\Utilities\OrderUtil' ) && OrderUtil::custom_orders_table_usage_is_enabled() ) { | |
| 79 | + if ( class_exists( '\Automattic\WooCommerce\Utilities\OrderUtil' ) && function_exists( 'wc_get_container' ) && OrderUtil::custom_orders_table_usage_is_enabled() ) { | |
| 80 | 80 | return " |
| 81 | 81 | SELECT o.id as id |
| 82 | 82 | FROM {$wpdb->prefix}wc_orders o |
| 83 | 83 | INNER JOIN {$wpdb->prefix}wc_orders_meta om ON o.id = om.order_id |