Skip to content

Instantly share code, notes, and snippets.

@csavoronin
Created July 24, 2019 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csavoronin/79f79866f1a925add7507cc4ca52c972 to your computer and use it in GitHub Desktop.
Save csavoronin/79f79866f1a925add7507cc4ca52c972 to your computer and use it in GitHub Desktop.
[!] {@24246}: Addons: Store locator: If the customer has a city without a pick-up point, a empty page was displayed. Fixed.
From fe2e25bdcb62e68bb0ada62dcd46439c2c394b2d Mon Sep 17 00:00:00 2001
From: Andrei Voronin <avoronin@avoronin.u.simtech>
Date: Wed, 24 Jul 2019 16:03:11 +0400
Subject: [PATCH] [!] {@24246}: Addons: Store locator: If the customer has a
city without a pick-up point, a empty page was displayed. Fixed.
---
.../controllers/frontend/store_locator.php | 23 ++++++++-----------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/app/addons/store_locator/controllers/frontend/store_locator.php b/app/addons/store_locator/controllers/frontend/store_locator.php
index 2b05acbe9c..a5ef6c7ec8 100644
--- a/app/addons/store_locator/controllers/frontend/store_locator.php
+++ b/app/addons/store_locator/controllers/frontend/store_locator.php
@@ -20,7 +20,7 @@
if ($mode == 'search') {
fn_add_breadcrumb(__('store_locator.stores_and_pickup_points'));
- $sl_search = isset($_REQUEST['sl_search']) ? $_REQUEST['sl_search'] : [];
+ $sl_search = isset($_REQUEST['sl_search']) ? (array) $_REQUEST['sl_search'] : [];
$params = [
'pickup_only' => isset($sl_search['pickup_only']),
'status' => 'A',
@@ -34,19 +34,14 @@
}
}
- if (!empty($sl_search)) {
- $sl_search['skip_city_lang'] = true;
- list($store_locations, $search) = fn_get_store_locations($sl_search);
- $grouped_locations = (new Collection($store_locations))->groupBy('city')->toArray();
-
- Tygh::$app['view']->assign([
- 'store_locations' => $grouped_locations,
- 'store_locations_count' => count($store_locations),
- ]);
- }
+ $sl_search['skip_city_lang'] = !empty($sl_search);
+ list($store_locations, $search) = fn_get_store_locations($sl_search);
+ $grouped_locations = (new Collection($store_locations))->groupBy('city')->toArray();
Tygh::$app['view']->assign([
- 'cities' => $cities,
- 'sl_search' => $sl_search,
+ 'store_locations' => $grouped_locations,
+ 'store_locations_count' => count($store_locations),
+ 'cities' => $cities,
+ 'sl_search' => $sl_search,
]);
-}
+}
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment