Merge pull request #624 from openclassify/dia

#1880 [advs-module] Add a setting to hide the standard price
This commit is contained in:
Ozcan Durak 2020-07-30 11:50:42 +03:00 committed by GitHub
commit 8ab05d35e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 4 deletions

View File

@ -34,6 +34,7 @@ return [
'watermark_image',
'watermark_position',
'listing_page_image',
'hide_standard_price_field',
],
],
'user' => [

View File

@ -170,6 +170,12 @@ return [
'mode' => 'upload',
]
],
'hide_standard_price_field' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'enabled_currencies' => [
'bind' => 'streams::currencies.enabled',
'env' => 'ADV_ENABLED_CURRENCIES',

View File

@ -216,7 +216,18 @@ $(document).ready(function () {
price = parseInt(price.replace(/\./g, ''));
let decimal = parseInt($(parent).find('.decimal-price').val());
$(parent).find('input[type=number]').val(parseFloat(price + "." + decimal));
const newPrice = parseFloat(price + "." + decimal)
let priceInput = $(parent).find('input[type=number]')
priceInput.val(newPrice);
if (priceInput[0].name === 'price') {
const event = new CustomEvent('priceChangedEvent', {
detail: {
newPrice
}
})
document.querySelector('#price').dispatchEvent(event)
}
});
// Add dynamic option creation

View File

@ -293,4 +293,7 @@ return [
// Select cat
'select_category_step_by_step' => 'Select Category Step by Step',
// New create page
'options' => 'Options',
];

View File

@ -118,6 +118,9 @@ return [
'listing_page_image' => [
'name' => 'Listing Page Image',
],
'hide_standard_price_field' => [
'name' => 'Hide Standard Price Field',
],
'enabled_currencies' => [
'name' => 'Enabled Currencies',
],

View File

@ -58,9 +58,10 @@
{{ form.fields.slug|raw }}
</div>
</div>
{{ addBlock('new-ad/fields',{'adv':adv})|raw }}
<div class="row form-group select-price">
{{ addBlock('new-ad/fields', {'adv': adv})|raw }}
<div class="row form-group select-price{{ setting_value('visiosoft.module.advs::hide_standard_price_field') ? ' d-none' }}">
<label class="col-sm-2 col-xs-12">
{{ form.fields.standard_price.label|raw }}
<span class="required">*</span>
@ -118,7 +119,7 @@
<div class="row form-group select-options">
<label for="selectOptions" class="col-sm-2">
Options
{{ trans('visiosoft.module.advs::field.options') }}
</label>
<div class="col-sm-10">
<select id="selectOptions" class="form-control options-tags" multiple="multiple"