mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
Merge pull request #624 from openclassify/dia
#1880 [advs-module] Add a setting to hide the standard price
This commit is contained in:
commit
8ab05d35e0
@ -34,6 +34,7 @@ return [
|
|||||||
'watermark_image',
|
'watermark_image',
|
||||||
'watermark_position',
|
'watermark_position',
|
||||||
'listing_page_image',
|
'listing_page_image',
|
||||||
|
'hide_standard_price_field',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'user' => [
|
'user' => [
|
||||||
|
|||||||
@ -170,6 +170,12 @@ return [
|
|||||||
'mode' => 'upload',
|
'mode' => 'upload',
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
'hide_standard_price_field' => [
|
||||||
|
'type' => 'anomaly.field_type.boolean',
|
||||||
|
'config' => [
|
||||||
|
'default_value' => false,
|
||||||
|
]
|
||||||
|
],
|
||||||
'enabled_currencies' => [
|
'enabled_currencies' => [
|
||||||
'bind' => 'streams::currencies.enabled',
|
'bind' => 'streams::currencies.enabled',
|
||||||
'env' => 'ADV_ENABLED_CURRENCIES',
|
'env' => 'ADV_ENABLED_CURRENCIES',
|
||||||
|
|||||||
@ -216,7 +216,18 @@ $(document).ready(function () {
|
|||||||
price = parseInt(price.replace(/\./g, ''));
|
price = parseInt(price.replace(/\./g, ''));
|
||||||
let decimal = parseInt($(parent).find('.decimal-price').val());
|
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
|
// Add dynamic option creation
|
||||||
|
|||||||
@ -293,4 +293,7 @@ return [
|
|||||||
|
|
||||||
// Select cat
|
// Select cat
|
||||||
'select_category_step_by_step' => 'Select Category Step by Step',
|
'select_category_step_by_step' => 'Select Category Step by Step',
|
||||||
|
|
||||||
|
// New create page
|
||||||
|
'options' => 'Options',
|
||||||
];
|
];
|
||||||
|
|||||||
@ -118,6 +118,9 @@ return [
|
|||||||
'listing_page_image' => [
|
'listing_page_image' => [
|
||||||
'name' => 'Listing Page Image',
|
'name' => 'Listing Page Image',
|
||||||
],
|
],
|
||||||
|
'hide_standard_price_field' => [
|
||||||
|
'name' => 'Hide Standard Price Field',
|
||||||
|
],
|
||||||
'enabled_currencies' => [
|
'enabled_currencies' => [
|
||||||
'name' => 'Enabled Currencies',
|
'name' => 'Enabled Currencies',
|
||||||
],
|
],
|
||||||
|
|||||||
@ -58,9 +58,10 @@
|
|||||||
{{ form.fields.slug|raw }}
|
{{ form.fields.slug|raw }}
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<label class="col-sm-2 col-xs-12">
|
||||||
{{ form.fields.standard_price.label|raw }}
|
{{ form.fields.standard_price.label|raw }}
|
||||||
<span class="required">*</span>
|
<span class="required">*</span>
|
||||||
@ -118,7 +119,7 @@
|
|||||||
|
|
||||||
<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">
|
||||||
Options
|
{{ trans('visiosoft.module.advs::field.options') }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="selectOptions" class="form-control options-tags" multiple="multiple"
|
<select id="selectOptions" class="form-control options-tags" multiple="multiple"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user