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.
Virtuemart - decimal quantity
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Virtuemart - decimal quantity
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
$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
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 12
- Joined: 26 Jun 2010, 22:58
Re: Virtuemart - decimal quantity
Sorry for my stupidity.
Im not PHP expert? Have somebody complex solution for this?
Thanks.
Im not PHP expert? Have somebody complex solution for this?
Thanks.
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Virtuemart - decimal quantity
Hi, which addon do you use, the old one or new version?
https://www.phoca.cz/documents/18-virtue ... eipt-addon
Jan
https://www.phoca.cz/documents/18-virtue ... eipt-addon
Jan
If you find Phoca extensions useful, please support the project