diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index 8c0a8a34a..75de1d0be 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -23,14 +23,23 @@ return [ 'latest-limit', 'popular_ads_limit', 'default_view_type', + 'hide_listing_standard_price', 'hide_zero_price', 'auto_approve', 'estimated_pending_time', 'default_published_time', 'default_GET', + 'listing_page_image', + ], + ], + 'create_ad' => [ + 'title' => 'visiosoft.module.advs::section.create_ad', + 'fields' => [ 'hide_standard_price_field', 'hide_options_field', - 'listing_page_image', + 'hide_village_field', + 'hide_configurations', + 'make_map_required', 'show_breadcrumb_when_creating_ad', ], ], diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index b7a24c416..7ef868ffe 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -125,6 +125,34 @@ return [ 'mode' => 'checkbox' ] ], + 'hide_village_field' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], + 'hide_configurations' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], + 'make_map_required' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], + 'hide_listing_standard_price' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + 'mode' => 'checkbox' + ] + ], 'enabled_currencies' => [ 'bind' => 'streams::currencies.enabled', 'env' => 'ADV_ENABLED_CURRENCIES', diff --git a/addons/default/visiosoft/advs-module/resources/js/required-map.js b/addons/default/visiosoft/advs-module/resources/js/required-map.js new file mode 100644 index 000000000..d3c296193 --- /dev/null +++ b/addons/default/visiosoft/advs-module/resources/js/required-map.js @@ -0,0 +1,7 @@ +$('#createEditAdvForm').submit(function () { + if ($('input[name=map_Val]').val().length === 0) { + alert(selectLocationAlert) + return false + } + return true +}) \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/message.php b/addons/default/visiosoft/advs-module/resources/lang/en/message.php index 04526f1d0..8fb05b55f 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/message.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/message.php @@ -25,4 +25,5 @@ return [ 'no_add_found' => 'No Ad Found!', 'replicated_success' => 'The ad has been replicated successfully!', 'ad_doesnt_exist' => "This ad doesn't exist!", + 'select_location_error' => "Please select a location on the map!", ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/section.php b/addons/default/visiosoft/advs-module/resources/lang/en/section.php index cdd4948d1..1992005b1 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/section.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/section.php @@ -41,6 +41,7 @@ return [ 'ads' => 'Ads', 'user' => 'User', 'filter' => 'Filter', + 'create_ad' => 'Create Ad', 'options' => [ 'title' => 'Options', ], diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index d4db6a482..56e9cf779 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -100,6 +100,20 @@ return [ 'hide_options_field' => [ 'name' => 'Hide Options Field', ], + 'hide_village_field' => [ + 'name' => 'Hide Village Field', + ], + 'hide_configurations' => [ + 'name' => 'Hide the Configurations Button', + 'instructions' => 'Hide the Configurations Button in the Ad Preview Page', + ], + 'make_map_required' => [ + 'name' => 'Make Map Required', + 'instructions' => 'Require the user to place a pin on the map when creating an ad', + ], + 'hide_listing_standard_price' => [ + 'name' => 'Hide Listing Standard Price', + ], 'enabled_currencies' => [ 'name' => 'Enabled Currencies', ], diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig index 0025fb8f8..4c2b43593 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig @@ -21,11 +21,13 @@
-

- {{ adv.standard_price != adv.price and adv.standard_price != '0' - ? adv.standard_price.currency() - : '' }} -

+ {% if not setting_value('visiosoft.module.advs::hide_listing_standard_price') %} +

+ {{ adv.standard_price != adv.price and adv.standard_price != '0' + ? adv.standard_price.currency() + : '' }} +

+ {% endif %} {{ adv.price != '0' ? adv.price.currency() : trans('visiosoft.module.advs::field.free') }} diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig index 40a74f785..73b7e6de6 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig @@ -206,6 +206,13 @@ var pick_option = "{{ trans('visiosoft.module.location::field.pick_option.name') }}" + {% if setting_value('visiosoft.module.advs::make_map_required') %} + + {{ asset_add("scripts.js", "visiosoft.module.advs::js/required-map.js") }} + {% endif %} + {{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }} {{ asset_add("scripts.js", "streams::js/form/form.js") }} {{ asset_add("scripts.js", "streams::js/form/translations.js") }} diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig index a3a710cec..2945d4193 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/preview/preview.twig @@ -16,10 +16,12 @@ {% else %} {% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %} {% endif %} - - {{trans('visiosoft.module.advs::button.create_configurations')}} - + {% if not setting_value('visiosoft.module.advs::hide_configurations') %} + + {{trans('visiosoft.module.advs::button.create_configurations')}} + + {% endif %} {{ trans('visiosoft.module.advs::field.edit') }} @@ -33,10 +35,12 @@
- - {{trans('visiosoft.module.advs::button.create_configurations')}} - + {% if not setting_value('visiosoft.module.advs::hide_configurations') %} + + {{trans('visiosoft.module.advs::button.create_configurations')}} + + {% endif %} {{ trans('visiosoft.module.advs::field.edit') }} diff --git a/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig b/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig index 77a332555..d5a8d5b59 100644 --- a/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig +++ b/addons/default/visiosoft/location-module/resources/views/new-ad/map.twig @@ -27,8 +27,10 @@ class="location-field district-data">{{ form.fields.district|raw }}
  • {{ form.fields.neighborhood|raw }}
  • -
  • {{ form.fields.village|raw }}
  • + {% if not setting_value('visiosoft.module.advs::hide_village_field') %} +
  • {{ form.fields.village|raw }}
  • + {% endif %}