amount format of the checkout module ?

Chrigel

Joined: 2003-12-25
Posts: 54
Posted: Thu, 2007-04-12 15:31

Hi

I'm using the checkout module version 0.1.14. Since my last gallery update I can't get the amount in the correct format. An example:

amount 3.00 after saving it's still on 3.00 (that's correct)

amount 2.60 after saving it changes to 2,6

As soon as I take other numbers then 0, it changes.

Why that and how can I solve it?

Best regards

Christian

 
mikyma

Joined: 2007-06-17
Posts: 3
Posted: Mon, 2007-06-18 18:36

Hallo

I have the same problem, the prices do no calculate when i use float Prices (1,50) on my german Site because php want to have dotet Prices and not with a komma !

Do anyone knows where checkout stores the prices of the items ? Then Icoul change them directly in the database or configfile.
Greets Michael

Nun auf Deutsch vielleicht verständlicher (-:

Bei der Eingabe des Preises wird der dezimalpunkt immmer in ein komma gewandelt und php rechnet aber mit Punkten als float trennzeichen!

Weiss jemand wo checkout den Preis für die Artikel speichert? Dann koennte ich das direkt in der DB oder configfile ändern

Gruesse Michael

 
mikyma

Joined: 2007-06-17
Posts: 3
Posted: Mon, 2007-06-18 19:05

Hey

now i have found the place where checkout stores its congig data:

In your album folder is a folder cache/module/checkout

edit the file 0.inc and change the komma in the prices into a dot!

But the real question is not solved! How do i prevent checkot to save the Prices with a komma but with a dot !?

 
nicolefou

Joined: 2007-03-02
Posts: 9
Posted: Mon, 2007-06-25 21:29

Hi Christian

I have fixed this issue by adding the following function in modules/checkout/Confirm.inc (just before the finale bracket closing the class)


 function formatPrice($value){
        return floatval(ereg_replace(',','.',$value));
 }

Then you need to replace all the variables $price[$x] by $this->formatPrice($price[$x]) and $items[$item->getId()]['itemPrices'][$x] by $this->formatPrice($items[$item->getId()]['itemPrices'][$x])

Hope this can help
Nico