diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig
index f411f6b22..ecc9f995c 100644
--- a/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig
+++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig
@@ -29,9 +29,9 @@
diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
index 3eb0e3e06..c1a714f3e 100644
--- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
+++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php
@@ -91,8 +91,10 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
});
}
}
- if (!empty($param['country'])) {
- $query = $query->where('country_id', $param['country']);
+ $country = isset($param['country']) ?
+ $param['country'] : setting_value('visiosoft.module.location::default_country');
+ if ($country) {
+ $query = $query->where('country_id', $country);
}
if ($city) {
$query = $query->where('city', $city->id);
diff --git a/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig b/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig
index 7681901a8..683f018e9 100644
--- a/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig
+++ b/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig
@@ -3,14 +3,21 @@
{{ trans('visiosoft.module.location::field.address.name') }}
- {% set country = setting_value('visiosoft.module.location::default_country') %}
- {% if app.request.get('country') %}
- {% set country = app.request.get('country') %}
- {% endif %}
+ {% set defaultCountry = setting_value('visiosoft.module.location::default_country') %}
+ {% set selectedCountry = app.request.get('country') %}
- {{ getCountry(country).name }}
+ {% set countryValue = '' %}
+ {% if selectedCountry %}
+ {% set countryName = getCountry(selectedCountry).name %}
+ {% set countryValue = defaultCountry == selectedCountry ? '' : selectedCountry %}
+ {% elseif defaultCountry %}
+ {% set countryName = getCountry(defaultCountry).name %}
+ {% else %}
+ {% set countryName = trans("visiosoft.module.location::field.country.name") %}
+ {% endif %}
+ {{ countryName }}
-
+