hydrolift Posted February 14, 2007 Share Posted February 14, 2007 How to use comma instead of dot in the shop I know howto. Just change in table "currencies". But how do I change so I can use comma when I put in price for a product in admin? I wan't it to be a safe way so any modules stop to work or the orderprocess freaks out, and the cardpayment stop to work. :blink: ;) 1500,00 instead of 1500.00 And as a bonus I wonder how to change from comma to only a space for every thousand? I've tried to use " " but it put out a & instead of a space: 1&500 instead of 1 500 Link to comment Share on other sites More sharing options...
hydrolift Posted February 20, 2007 Author Share Posted February 20, 2007 I try again! :rolleyes: I've found that in VirtueMart they also had a function "updateGross" where it is a function to change a comma "," to a dot ".". How to implent that in osCommerce "updateGross"? Here is the code for VirtueMart: function updateGross() { if( document.adminForm.product_price.value != '' ) { var taxRate = getTaxRate(); var r = new RegExp("\,", "i"); document.adminForm.product_price.value = document.adminForm.product_price.value.replace( r, "." ); var grossValue = document.adminForm.product_price.value; if (taxRate > 0) { grossValue = grossValue * (taxRate + 1); } document.adminForm.product_price_incl_tax.value = doRound(grossValue, 5); } } Here is the code for osCommerce where "var r" should be implented:[qoute] function updateGross() { var taxRate = getTaxRate(); var grossValue = document.forms["new_product"].products_price.value; if (taxRate > 0) { grossValue = grossValue * ((taxRate / 100) + 1); } document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4); } Here is the form in osCommerce: <td class="smallText"><?php echo tep_draw_separator('pixel_trans.gif', '24', '1') . ' ' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td> And then bonus, how to get rid of the "&" when using " "... ;) Link to comment Share on other sites More sharing options...
hydrolift Posted February 22, 2007 Author Share Posted February 22, 2007 Anyone with an idea? :sweating: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.