From d19bb30bcea114643aebab25a20c5490c4688795 Mon Sep 17 00:00:00 2001 From: amit sharma Date: Tue, 22 Sep 2026 14:53:46 +0530 Subject: [PATCH 1/2] Fixed: Resolve issue where retail price shows as "NaN" after entering the pre-tax retail price Co-authored-by: Name --- js/admin/price.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/admin/price.js b/js/admin/price.js index 872028722..3b4b36c98 100644 --- a/js/admin/price.js +++ b/js/admin/price.js @@ -97,7 +97,7 @@ function removeTaxes(price) function getEcotaxTaxIncluded() { - return ps_round(ecotax_tax_excl * (1 + ecotaxTaxRate), 2); + return ps_round((isNaN(ecotax_tax_excl) ? 0 : ecotax_tax_excl) * (1 + ecotaxTaxRate), 2); } @@ -187,7 +187,8 @@ function calcPriceTI() function calcPriceTE() { - ecotax_tax_excl = $('#ecotax').val() / (1 + ecotaxTaxRate); + var ecotaxValue = parseFloat($('#ecotax').val()); + ecotax_tax_excl = isNaN(ecotaxValue) ? 0 : (ecotaxValue / (1 + ecotaxTaxRate)); var priceTI = parseFloat($('#priceTI').val().replace(/,/g, '.')); var newPrice = removeTaxes(ps_round(priceTI - getEcotaxTaxIncluded(), priceDisplayPrecision)); var tourismTaxIncluded = getTourismTaxIncluded(newPrice); From 62d49283cd043fcf2906137064ba3a22b1202be8 Mon Sep 17 00:00:00 2001 From: amit sharma Date: Mon, 28 Sep 2026 11:32:50 +0530 Subject: [PATCH 2/2] Fixed: resolve code review changes --- js/admin/price.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/admin/price.js b/js/admin/price.js index 3b4b36c98..de5ebc623 100644 --- a/js/admin/price.js +++ b/js/admin/price.js @@ -187,8 +187,9 @@ function calcPriceTI() function calcPriceTE() { - var ecotaxValue = parseFloat($('#ecotax').val()); - ecotax_tax_excl = isNaN(ecotaxValue) ? 0 : (ecotaxValue / (1 + ecotaxTaxRate)); + if ($('#ecotax').length) { + ecotax_tax_excl = $('#ecotax').val() / (1 + ecotaxTaxRate); + } var priceTI = parseFloat($('#priceTI').val().replace(/,/g, '.')); var newPrice = removeTaxes(ps_round(priceTI - getEcotaxTaxIncluded(), priceDisplayPrecision)); var tourismTaxIncluded = getTourismTaxIncluded(newPrice);