From 12e84afdf80af9f31ddb89946a597c3016541035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Chans=C3=A9aume?= Date: Tue, 15 Jul 2014 16:39:13 +0200 Subject: [PATCH] Fixed wrong calculated price when comma is used instead of dot. --- templates/backOffice/default/categories.html | 6 ++++++ templates/backOffice/default/product-edit.html | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/backOffice/default/categories.html b/templates/backOffice/default/categories.html index 2cd4e0309..4a8b69d37 100644 --- a/templates/backOffice/default/categories.html +++ b/templates/backOffice/default/categories.html @@ -794,10 +794,16 @@ captureLength: 1, wait : 300, callback : function () { + var price = $(this).val(); + $(this).val(sanitizeFloat(price)); update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price')); } }); + function sanitizeFloat(numVal) { + return numVal.replace(",", "."); + }; + }); {/block} diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html index 72df5e344..253b99e60 100644 --- a/templates/backOffice/default/product-edit.html +++ b/templates/backOffice/default/product-edit.html @@ -363,10 +363,16 @@ $(function() { captureLength: 1, wait : 300, callback : function () { - update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price')); + var price = $(this).val(); + $(this).val(sanitizeFloat(price)); + update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price')); } }); + function sanitizeFloat(numVal) { + return numVal.replace(",", "."); + }; + // Count generated combinations in real time function countGeneratedCombinations() {