Fixed: guest were able to view non location catgories in the search result page by changing the location id

This commit is contained in:
vishalsingh.qlo325
2025-02-05 13:00:15 +05:30
parent 0c5ef158fb
commit d4e493feb0

View File

@@ -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;