Merge pull request #1015 from openclassify/vedatakd

fixed simple options for cart && optional detailed product option
This commit is contained in:
Muammer Top 2021-03-31 12:54:47 +03:00 committed by GitHub
commit ee5ccc67c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 37 deletions

View File

@ -23,6 +23,7 @@ return [
'ads' => [ 'ads' => [
'title' => 'visiosoft.module.advs::section.ads', 'title' => 'visiosoft.module.advs::section.ads',
'fields' => [ 'fields' => [
'detailed_product_options',
'latest-limit', 'latest-limit',
'popular_ads_limit', 'popular_ads_limit',
'ads_image_limit', 'ads_image_limit',

View File

@ -431,4 +431,10 @@ return [
] ]
], ],
'disable_sentry' => 'anomaly.field_type.boolean', 'disable_sentry' => 'anomaly.field_type.boolean',
'detailed_product_options' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
]
],
]; ];

View File

@ -31,4 +31,5 @@ return [
'passive_status_change' => "Your Ad's Status Has Been Set to Passive!", 'passive_status_change' => "Your Ad's Status Has Been Set to Passive!",
'sold_status_change' => "Your Ad's Status Has Been Set to Sold!", 'sold_status_change' => "Your Ad's Status Has Been Set to Sold!",
'status_change' => "Your Ad's Status Has Been Set to :status!", 'status_change' => "Your Ad's Status Has Been Set to :status!",
'disabled_detailed_options_for_admin_role' => "Detailed product options are disabled.",
]; ];

View File

@ -258,4 +258,8 @@ return [
'name' => 'Watermark', 'name' => 'Watermark',
'instructions' => 'Is watermark active?' 'instructions' => 'Is watermark active?'
], ],
'detailed_product_options' => [
'name' => 'Detailed Product Options',
'instructions' => 'Allows you to enter stock and price information for the product'
],
]; ];

View File

@ -134,6 +134,7 @@
</div> </div>
{% if not setting_value('visiosoft.module.advs::hide_options_field') %} {% if not setting_value('visiosoft.module.advs::hide_options_field') %}
{% if not setting_value('visiosoft.module.advs::detailed_product_options') %}
<div class="row form-group select-options"> <div class="row form-group select-options">
<label for="selectOptions" class="col-sm-2"> <label for="selectOptions" class="col-sm-2">
{{ trans('visiosoft.module.advs::field.options') }} {{ trans('visiosoft.module.advs::field.options') }}
@ -150,8 +151,16 @@
{% endif %} {% endif %}
</select> </select>
</div> </div>
{% if auth_check() and auth_user().hasRole('admin') %}
<div class="col-12 text-right py-2">
<p class="text-muted">
<i class="fa fa-exclamation-triangle"></i>
{{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }}
</p>
</div> </div>
{% endif %}
</div>
{% else %}
<div class="row form-group product-options"> <div class="row form-group product-options">
<label for="productOptions" class="col-sm-2"> <label for="productOptions" class="col-sm-2">
{{ trans('visiosoft.module.advs::field.product_option.name') }} {{ trans('visiosoft.module.advs::field.product_option.name') }}
@ -161,6 +170,7 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% endif %}
</div> </div>
<h5 class="mt-5 pb-1 border-bottom">{{ trans('visiosoft.module.advs::field.ad_desc') }}</h5> <h5 class="mt-5 pb-1 border-bottom">{{ trans('visiosoft.module.advs::field.ad_desc') }}</h5>

View File

@ -9,6 +9,12 @@
<br> <br>
{{ trans('visiosoft.module.advs::field.preview_text.part_2') }} {{ trans('visiosoft.module.advs::field.preview_text.part_2') }}
</p> </p>
{% if auth_check() and auth_user().hasRole('admin') %}
<p class="text-muted text-center mb-0">
<i class="fa fa-exclamation-triangle"></i>
{{ trans('visiosoft.module.advs::message.disabled_detailed_options_for_admin_role') }}
</p>
{% endif %}
</div> </div>
<div class="preview-actions text-center"> <div class="preview-actions text-center">
{% 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')) %} {% 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,11 +25,13 @@
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %} {% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
{% endif %} {% endif %}
{% if not setting_value('visiosoft.module.advs::hide_configurations') %} {% if not setting_value('visiosoft.module.advs::hide_configurations') %}
{% if setting_value('visiosoft.module.advs::detailed_product_options') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}" <a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white"> class="btn btn-warning shadow-sm mr-4 text-white">
{{ trans('visiosoft.module.advs::button.create_configurations') }} {{ trans('visiosoft.module.advs::button.create_configurations') }}
</a> </a>
{% endif %} {% endif %}
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" <a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border"> class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }} {{ trans('visiosoft.module.advs::field.edit') }}
@ -43,7 +51,8 @@
{{ trans('visiosoft.module.advs::button.create_configurations') }} {{ trans('visiosoft.module.advs::button.create_configurations') }}
</a> </a>
{% endif %} {% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" class="btn preview-edit shadow-sm border"> <a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }} {{ trans('visiosoft.module.advs::field.edit') }}
</a> </a>
<a href="{{ continueLink }}" class="btn preview-continue shadow-sm ml-4"> <a href="{{ continueLink }}" class="btn preview-continue shadow-sm ml-4">

View File

@ -87,13 +87,13 @@ class ExceptionHandler extends Handler
public function report(Exception $e) public function report(Exception $e)
{ {
if (!setting_value('visiosoft.module.advs::disable_sentry') if (app()->bound('sentry')
&& app()->bound('sentry')
&& $this->shouldReport($e) && $this->shouldReport($e)
&& env('SENTRY_LARAVEL_DSN')) { && env('SENTRY_LARAVEL_DSN')) {
if (!setting_value('visiosoft.module.advs::disable_sentry')) {
app('sentry')->captureException($e); app('sentry')->captureException($e);
} }
}
parent::report($e); parent::report($e);
} }