diff --git a/addons/default/visiosoft/advs-module/resources/js/new-create.js b/addons/default/visiosoft/advs-module/resources/js/new-create.js index 9feff947b..368260725 100644 --- a/addons/default/visiosoft/advs-module/resources/js/new-create.js +++ b/addons/default/visiosoft/advs-module/resources/js/new-create.js @@ -210,15 +210,13 @@ $(document).ready(function () { }); - $(".priceField, .priceDecimalField, .standard-price-field, .standard-price-decimal-field").on('change', function () { - let price = $(".priceField").val() === "" ? '0' : $(".priceField").val(); - let standardPrice = $(".standard-price-field").val() === "" ? '0' : $(".standard-price-field").val(); + $(".decimal-price, .whole-price").on('change', function (e) { + const parent = e.target.closest('.select-price') + let price = $(parent).find('.whole-price').val() === "" ? '0' : $(parent).find('.whole-price').val(); price = parseInt(price.replace(/\./g, '')); - standardPrice = parseInt(standardPrice.replace(/\./g, '')); - let decimal = parseInt($(".priceDecimalField").val()); - let standardDecimal = parseInt($(".standard-price-decimal-field").val()); - $('.priceHidden').find('input').val(parseFloat(price + "." + decimal)); - $('.standard-price-hidden').find('input').val(parseFloat(standardPrice + "." + standardDecimal)); + let decimal = parseInt($(parent).find('.decimal-price').val()); + + $(parent).find('input[type=number]').val(parseFloat(price + "." + decimal)); }); // Add dynamic option creation 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 7556dbd69..e5ee80ee4 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 @@ -72,10 +72,10 @@ {% set standardPriceValue = form.fields.standard_price.value|split('.') %}
- +
-
@@ -92,10 +92,10 @@ {% set PriceValue = form.fields.price.value|split('.') %}
- +
-