From 07eef2d717c21fd532156862b369bf457fb276f8 Mon Sep 17 00:00:00 2001 From: Susanna <8512388+vandekul@users.noreply.github.com> Date: Mon, 27 Apr 2020 18:31:52 +0200 Subject: [PATCH] Fix matching zones query for working with sqlite And probably other databases too. --- includes/data-stores/class-wc-shipping-zone-data-store.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-shipping-zone-data-store.php b/includes/data-stores/class-wc-shipping-zone-data-store.php index e4a55322bef..453ec877f15 100644 --- a/includes/data-stores/class-wc-shipping-zone-data-store.php +++ b/includes/data-stores/class-wc-shipping-zone-data-store.php @@ -282,7 +282,7 @@ class WC_Shipping_Zone_Data_Store extends WC_Data_Store_WP implements WC_Shippin "SELECT zones.zone_id FROM {$wpdb->prefix}woocommerce_shipping_zones as zones LEFT OUTER JOIN {$wpdb->prefix}woocommerce_shipping_zone_locations as locations ON zones.zone_id = locations.zone_id AND location_type != 'postcode' WHERE " . implode( ' ', $criteria ) // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared - . ' ORDER BY zone_order ASC, zone_id ASC LIMIT 1' + . ' ORDER BY zone_order ASC, zones.zone_id ASC LIMIT 1' ); }