Author Topic: Vodes with cents  (Read 2713 times)

Triky

  • Newbie
  • *
  • Posts: 1
    • View Profile
Vodes with cents
« on: 21 January 2009, 16:42 »
Thank you for this free extension, it was very useful!
On my website I need to see the money (euro) that my customers pay in cash or by paypal.
I'm using the "PayPal IPN system" and also I have to add the cash manually in the back-end menu Component/ Vodes / Credits.

The relation I need is 1 euro = 1 Vodes, and I also need to have the cents in the accounts, for example, 1.6 euro must not become 1 or 2 Vodes but remain 1.6 Vodes.

Can you help me? I'm not very good to use PHP!

For paypal payment , I believe this changes, in the file "vodes.php", should be enough:

$credit = ceil($payment_amount)*10;
to
$credit = $payment_amount;

but, for the manual insertion in Vodes/Credits/Edit, I don't find the functions "ceil, floor, round", I don't know how to avoid that the figures will be rounded.

I think the problem is simple to resolve for those who know PHP, but I'm not able to do it, I hope you can

help me!

Thank you.

Triky
Italy
« Last Edit: 21 January 2009, 16:50 by Triky »

Saka

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,115
    • View Profile
    • Sakic.Net
Re: Vodes with cents
« Reply #1 on: 21 January 2009, 20:35 »
I think the main problem is that the credit is defined as integer in the database table:
`credit` int(11) NOT NULL default '0'
so you can't have it as float.

You should change this to varchar or something in the manifest (vodes.xml) first and then reinstall.