manilow
VP-CART New User
France
134 Posts |
Posted - February 25 2009 : 10:06:16
|
I met the same problem. xlcid set to 1036 the prices were displayed correctly, for example: 1 234,56 € (I put the € behind the amount).
However, when adding or updating products, the amounts were multiplied by 100; using a dot as decimal point, an error was displayed asking for a numeric value.
To fix this, I added the cCur function in line 2176 of the shopa_addproduct.asp file:
pupdatefield "cprice", ccur(curcprice)
It seems to work fine this way.
|
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - February 25 2009 : 11:12:11
|
I've also had similar problems (european server, eg germany which uses commas, but want to display things in uk formats, ie decimal points; also want the option to be able to display things with either of those formats from the customer and admin sides depending on which ccy/language is being chosen by the customer/admin user. (eg for a site which sells to, say, the uk, and also to germany or italy etc, via a german server)
I've tried loads of things on this, and built a test file to see at which point things go wrong with the various different lcid settings and entering differently formatted amounts.
The core problem seems to only happen when you have a field/value which is retrieved as a text value (eg reading a field without converting it to a number, or setting something to a literal value like "1.2" etc). When things are explicitly converted to numbers it all works fine as long as the right lcid is set.
The xconverteuropeannumbers option (which corrects this problem) only gets used in a handful of instances. The customer side is fairly well sorted out, but the admin side goes horribly wrong if you have a mis-matching session lcid with the server's region.
Manilow's solution is the kind of thing that I was thinking about too, but it's the last resort (the rest of admin is still broken when it comes to anything that does direct cursor updates from field derived values), I'd still like to find out how to switch things fully between formats without having to butcher the cart, but having looked at the code I don't think it can be done without doing the kind of changes across the board in admin that manilow mentions. If anyone knows different, please let us know!
(By switching the lcid to mis-match against the server's region, the only things that seem to break is direct cursor updates from field-driven values; everything else works fine in the internal calculation aspects etc)
My test file was generic asp, totally outside vpasp, but it showed where the problems occur; trouble is I haven't managed to find a generic top level setting that can sort it out. If the value doesn't get explicitly converted/casted then it always ends up going wrong regardless of the lcid settings in the file.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on February 25 2009 11:22:19 |
|
|