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 350650d03..2c4ab7f5a 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -23,6 +23,7 @@ return [ 'ads' => [ 'title' => 'visiosoft.module.advs::section.ads', 'fields' => [ + 'detailed_product_options', 'latest-limit', 'popular_ads_limit', 'ads_image_limit', 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 f0cb1dbf0..b3b1734d9 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -431,4 +431,10 @@ return [ ] ], 'disable_sentry' => 'anomaly.field_type.boolean', + 'detailed_product_options' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => true, + ] + ], ]; 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 64e9a67a5..c60c9eeab 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/message.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/message.php @@ -31,4 +31,5 @@ return [ 'passive_status_change' => "Your Ad's Status Has Been Set to Passive!", 'sold_status_change' => "Your Ad's Status Has Been Set to Sold!", 'status_change' => "Your Ad's Status Has Been Set to :status!", + 'disabled_detailed_options_for_admin_role' => "Detailed product options are disabled.", ]; 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 1d3b65e30..803e3403f 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -258,4 +258,8 @@ return [ 'name' => 'Watermark', 'instructions' => 'Is watermark active?' ], + 'detailed_product_options' => [ + 'name' => 'Detailed Product Options', + 'instructions' => 'Allows you to enter stock and price information for the product' + ], ]; 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 cc8e97809..dd6532f7f 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 @@ -134,32 +134,42 @@ {% if not setting_value('visiosoft.module.advs::hide_options_field') %} -
- -
- + {% if not setting_value('visiosoft.module.advs::detailed_product_options') %} +
+ +
+ +
+ {% if auth_check() and auth_user().hasRole('admin') %} +
+

+ + {{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }} +

+
+ {% endif %}
-
- -
- -
- {{ form.fields.product_options_value.configSet('cat1',adv.cat1).input|raw }} + {% else %} +
+ +
+ {{ form.fields.product_options_value.configSet('cat1',adv.cat1).input|raw }} +
-
+ {% endif %} {% endif %}
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 e0ed36c0c..b2f6b6724 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 @@ -9,6 +9,12 @@
{{ trans('visiosoft.module.advs::field.preview_text.part_2') }}

+ {% if auth_check() and auth_user().hasRole('admin') %} +

+ + {{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }} +

+ {% endif %}
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %} @@ -19,10 +25,12 @@ {% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %} {% endif %} {% if not setting_value('visiosoft.module.advs::hide_configurations') %} - - {{trans('visiosoft.module.advs::button.create_configurations')}} - + {% if setting_value('visiosoft.module.advs::detailed_product_options') %} + + {{ trans('visiosoft.module.advs::button.create_configurations') }} + + {% endif %} {% endif %} @@ -33,17 +41,18 @@
- {% include "visiosoft.module.advs::new-ad/preview/partials/preview-window" %} + {% include "visiosoft.module.advs::new-ad/preview/partials/preview-window" %}
{% if not setting_value('visiosoft.module.advs::hide_configurations') %} - {{trans('visiosoft.module.advs::button.create_configurations')}} + {{ trans('visiosoft.module.advs::button.create_configurations') }} {% endif %} - + {{ trans('visiosoft.module.advs::field.edit') }}