From d4e493feb06d63fe34efd9c867c15e06506763c3 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 5 Feb 2025 13:00:15 +0530 Subject: [PATCH] Fixed: guest were able to view non location catgories in the search result page by changing the location id --- modules/wkroomsearchblock/classes/WkRoomSearchHelper.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php index bfad4164f..4a9339338 100644 --- a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php +++ b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php @@ -175,8 +175,12 @@ class WkRoomSearchHelper if ($locationCategoryId) { $objLocationCategory = new Category($locationCategoryId, $context->language->id); - $searchedData['location'] = $objLocationCategory->name; - $searchedData['location_category_id'] = $locationCategoryId; + if ($objLocationCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { + $searchedData['location'] = $objLocationCategory->name; + $searchedData['location_category_id'] = $locationCategoryId; + } else { + $locationCategoryId = false; + } } $searchedData['order_date_restrict'] = false;