Forums

Calculating registration form totals

sharonbetts 29 Aug, 2014
I am building a renewal form for a club with several options - all at their own cost.
Is there a way to have these items totaled within Chronoforms to avoid errors in the Paypal payment amounts?

Thank you
Max_admin 29 Aug, 2014
How exactly ? if you set the amount field in PayPal Redirect to say "total", then you can do some calculations inside a "custom code" action before the PayPal Redirect:
<?php
$form->data["total"] = $form->data["field1"] + $form->data["field2"];
?>
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 29 Aug, 2014
Hi sharonbetts,

I would do it first with custom JavaScript in the form display to show the user what the total cost is; and second with PHP after the form is submitted to check that the total is correct before payment.

Bob
sharonbetts 29 Aug, 2014
Sounds wonderful, Bob - but way out of my skill set -
Is there a way to post the total to the form after calculating it and before redirecting it to Paypal?
sharonbetts 30 Aug, 2014
So, it looks like they would need the Advanced API through Paypal which would add too much to their bottom line. I just need a quick way to total the fields they select.
GreyHead 30 Aug, 2014
Hi sharonbetts,

Please see Max's post before mine,

You may not need the PayPal Redirect action - you can make a simple PayPal payment using the ReDirect action provided that you don't need instant notification.

Bob
sharonbetts 30 Aug, 2014
Answer
Thank you - I will use Max's suggestion and do a simple payment. Appreciate your time - sorry, I am not up-to-par on javascripting.
This topic is locked and no more replies can be posted.