Multiple ways of calculation
-
I’m trying to achieve a simple solution for a calculation problem.
I need to get a specific outcome in the WordPress-Plugin “Contact Form 7” using this equation(((values1 * values2)+18) * values3 * values4)
Overall the equation brings ok results but I needed to update it. The contact form was used to calculate the insurance value from one insurance giver, but now i have to provide a second outcome from a second company in the same form with more variables.
I’ve tried this.
[calculation Calculation-field precision:0 roundup "(((values1 * values2)+18) * values3 * values4)" "fn_php( if($_POST{'values1'} == 566 && $_POST{'values2'} == 1 && $_POST{'values4'} == 2) return 400; if($_POST{'values1'} == 566 && $_POST{'values2'} == 1 && $_POST{'values4'} == 3) return 440; if($_POST{'values1'} == 566 && $_POST{'values2'} == 1 && $_POST{'values4'} == 4) return 480; if($_POST{'values1'} == 566 && $_POST{'values2'} == 1 && $_POST{'values4'} == 5) return 520; if($_POST{'values1'} == 566 && $_POST{'values2'} == 1 && $_POST{'values4'} == 6) return 560; )"]
Obviously it doesnt work.
Thanks in advance and sorry if it’s not understandable. I’m almost giving up…
As I’m giving up almost I’ve also tried deleting the old calculation method and getting a text output into the calculation field. Tried adding a
if($_POST{'values1'} == 566 && $_POST{'values2'} == 0.684) return 'Individual calculation. Contact our agent';
Tried changing return to echo, even print, but no results. I guess the plugin has some limitations or I’m doing something terribly wrong.
The page I need help with: [log in to see the link]
- The topic ‘Multiple ways of calculation’ is closed to new replies.