Comma in amount field JoomDonation AND PaymentForm

  • kbarnes
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 6 months ago #5386 by kbarnes
This relates to JoomDonation AND PaymentForm. In the amount field in which someone can enter his own (in my case dollar) amount an issue exists where if someone enters a comma into the field it just processes the number before the comma. (If someone enters 3,500 then JoomDonation or PayMent Form processes it as 3).

This is a problem in the U.S. because most people automatically put a comma into a dollar amount $1,000 or more. I can tell them not to enter a comma, but it seems a workaround to me rather than the right solution.

I will try to fix this myself if you don't mind telling me the php pages for both JoomDonation and PaymentForm where the code related to this function exists.

Thanks again very much.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #5409 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Comma in amount field JoomDonation AND PaymentForm
Hi

For Joom Donation, please open the file components/com_jdonation/views/confirmation/view.html.php, look at line 25, you will see this code :
Code:
$layout = $this->getLayout();

Please add the below lines of code before the line 25 :
Code:
if (isset($_POST['amount'])) { $_POST['amount'] = str_replace(',', '', $_POST['amount']) ; }

For Payment Form, open the file components/com_pmform/views/confirmation/view.html.php, look at line 25, you will see this code :
Code:
global $Itemid;

Please add these below lines of code before the above line :
Code:
if (isset($_POST['amount'])) { $_POST['amount'] = str_replace(',', '', $_POST['amount']) ; }

After that, everything will work as expected. Please let me know if you need more help .

Thanks,

Tuan

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #8507 by Erin Fernandez
Replied by Erin Fernandez on topic Re: Comma in amount field JoomDonation AND PaymentForm
this is not working for me in joom donation. the comma remains

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #8509 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Comma in amount field JoomDonation AND PaymentForm
@eandafern : I replied you on other post . Basically, you are using an old version of the extension, so upgrade your site to this latest version will solve the problem !

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamDũng Nguyễn Việt