Created
August 16, 2021 08:19
-
-
Save danielborzov/778a31657e0b30033297a4d036c1ad0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/store_locator/controllers/frontend/store_locator.php b/app/addons/store_locator/controllers/frontend/store_locator.php | |
index 2e3e9c45e0..0f25d0a423 100644 | |
--- a/app/addons/store_locator/controllers/frontend/store_locator.php | |
+++ b/app/addons/store_locator/controllers/frontend/store_locator.php | |
@@ -81,6 +81,13 @@ if ($mode == 'search') { | |
]; | |
}); | |
+ if (isset($params['ids'])) { | |
+ $cities[] = [ | |
+ 'id' => $params['ids'], | |
+ 'text' => $params['ids'] | |
+ ]; | |
+ } | |
+ | |
/** @var \Tygh\Ajax $ajax */ | |
$ajax = Tygh::$app['ajax']; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/store_locator/func.php b/app/addons/store_locator/func.php | |
index 91f5cf8c2a..52053933e3 100644 | |
--- a/app/addons/store_locator/func.php | |
+++ b/app/addons/store_locator/func.php | |
@@ -390,12 +390,11 @@ function fn_get_store_location_cities(array $params = []) | |
if ($params['items_per_page']) { | |
$params['total_items'] = (int) db_get_field( | |
- 'SELECT COUNT(1) AS count' . | |
+ 'SELECT COUNT(DISTINCT(city)) AS count' . | |
' FROM ?:store_locations AS locations' . | |
' LEFT JOIN ?:store_location_descriptions AS descriptions' . | |
' ON locations.store_location_id = descriptions.store_location_id' . | |
- ' WHERE ?p' . | |
- ' GROUP BY city', | |
+ ' WHERE ?p', | |
implode(' AND ', $condition) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment