Page 1 of 1

Virtuemart - decimal quantity

Posted: 09 Aug 2010, 08:12
by sender
I use this hack for selling decimal quantity in Virtuemart - and I have little problem

http://forum.virtuemart.net/index.php?t ... t=prev#new

this solution is working fine but I have a problem:
My customers still have to type 0.5 instead of 0,5 (my shop is located in Czech republic aswell)?

So you are a master in PHP and Virtuemart too. Can you provide the solution for Europe for it? I think that this is problem for many e-shops who want to sell goods in meters and kg, l.

If you can not interesting in it, never mine.

Thanks anyway.

Re: Virtuemart - decimal quantity

Posted: 16 Aug 2010, 20:15
by Jan
Just make some str_replace function:

$value = str_replace(',', '.', $value);

So if user add 5,50 this will be translated to 5.50

The same you can make for outputs:

if somewhere will be loaded 5.50 ... this will be changed to 5,50 (for formfields)

$value = str_replace('.', ',', $value);

Jan

Re: Virtuemart - decimal quantity

Posted: 17 Aug 2010, 13:54
by sender
Sorry for my stupidity.

Im not PHP expert? Have somebody complex solution for this?

Thanks.

Re: Virtuemart - decimal quantity

Posted: 16 Nov 2010, 18:44
by Jan
Hi, which addon do you use, the old one or new version?

https://www.phoca.cz/documents/18-virtue ... eipt-addon

Jan