Topic: eform question  (Read 370 times)

Pages: [1]   Go Down

#1: 5-Jun-2009, 03:24 PM


joshlfisher
Posts: 239

WWW
I have an event registration form powered by eform, you can see it in action here: http://ww4w2009.com/vendor-registration.html

There are several options that affect the total price that a vendor pays, and I was wondering if there is a way to have the total displayed on the thankyou page, and in the autoresponder email.

Right now, the thankyou page is just showing the options, and how much they cost with pricing examples.

If you test out the form, just put test as the first and last name.



Visit Knight Technology Solutions at http://knightechnologysolutions.com

#2: 9-Jun-2009, 12:33 PM

Moderator

TobyL
Posts: 1,023

Use the eFormOnValidate event and do any calculations in the event function, then set the total in the fields array and provide a placeholder for this in your report templates:

Code:
<?php
if(!function_exists('efCalculateTotals'){
   function 
efCalculateTotals(&$fields){

      if(
$fields['choice_1']) $total += 25;
      if(
$fields['choice_2']) $total += 50;
      
//etcetera

      //in your report have a [+formTotal+] placeholder
      
$fields['formTotal'] = $total;
      
      return 
true//important!

   
}
}
?>

Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.