Buy Now
Sign in

How to subtract two fields and show result in email

spytech , June 16 at 10:38
S
spytech
Hi, I have two fields {price} and {deposit}. I would like to subtract deposit from price and show the value in an email. I assume I need to add some PHP code within the 'SETUP' section that does the calculation and outputs the answer to a field, I can then add the Var to the email.
I have searched the forums and can not find and example of how to write the PHP code.
Any help would be really appreciated.
Thanks.
H
healyhatman
$this->get("varname", "default value if not found"); for things you would get with {var}
$this->data("field", "default"); for {data}
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman
S
spytech
Hi, I am looking to subtract the {deposit} field from the {price} field and show the result as a VAR. I am not sure if the code you have provided would do that?
Am I missing something?​
​Thanks​
H
healyhatman
The code I gave you shows how to get a {var:} or {data:} value, since you can't use shortcode in PHP. Return the value you want, then display it elsewhere using {var:php_action_name}
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman