Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Still problem with comma delimiter in prices


Tata

Recommended Posts

I posted here a question on using comma as a decimal delimiter. Immediately I got the answer.

I changed the settings in Localisation>Currencies (comma as dec. delimiter, dot as 1000 delimiter). That's the waz how the prices are shown for visitors. But still, when inserting prices in admin area, I must only use the dot as dec. delimiter or the prices are rounded and tax is not calculated at all. Why can't I change also this feature? I mean - insert prices of new products in our standard national form: 1.234.567,89 SKK or 1 234 567,89 SKK? Please, this help is pretty urgent. If there is a hint, please send it to [email protected]. THXIA.

Link to comment
Share on other sites

  • 1 year later...

Comma decimal separators may be correct for Swedish and Danish currency but they are not correct for calculation .. these values are manipulated by javascript calculations which require the decimal to be a point.

 

To achieve what you want you would need to alter the javascript to convert the value in then convert the value out. I only took a quick look so no promises but try replacing the following two javascript functions in admin/categories.php ( about line 464 ).

 

function updateGross() {
 var taxRate = getTaxRate();
 var grossValue = document.forms["new_product"].products_price.value;
 grossValue = grossValue.replace(',', '.');
 if (taxRate > 0) {
   grossValue = grossValue * ((taxRate / 100) + 1);
 }
 grossValue = doRound(grossValue, 4);
 document.forms["new_product"].products_price_gross.value = grossValue.toString().replace('.', ',');
}

function updateNet() {
 var taxRate = getTaxRate();
 var netValue = document.forms["new_product"].products_price_gross.value;
 netValue = netValue.replace(',', '.');
 if (taxRate > 0) {
   netValue = netValue / ((taxRate / 100) + 1);
 }
 netValue = doRound(netValue, 4);
 document.forms["new_product"].products_price.value = netValue.toString().replace('.', ',');
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...