I'm having an impossible time with finding documentation or a plugin to do what I'd like. I was hoping someone out here might have an idea, since the only results from 4 hours of Googling are for LaTeX or another pluging meant to display math functions, rather than solve them.
Situation:
- I have a form that, on completion, sends the user to a landing page.
- On redirect, the form entries are passed using URL variables.
- I have a function that displays these variables on the page (listed below) that is working perfectly.
- I would like to calculate these variables on my page by using a shortcode.
function URLParam( $atts ) {
extract( shortcode_atts( array(
'param' => 'param',
), $atts ) );
return $_GET[$param];
}
add_shortcode('URLParam', 'URLParam');
The intended functionality is to use something like [math] 6 * 6 [/math] in order to output 36.
Usage Example:
URL: domain.com/results/&orders=128&rev=3800
In the (Swift Pagebuilder) Text Block, I'd like to be able to write:
According to this data, your average order value is $[math round='2'] [URLParam param='rev']/[URLParam param='orders'][/math]
The output would read:
According to this data, your average order value is $29.69
The only other option I can see is to create a custom GF that has hidden number fields that populate using the URL params. Then, create a calculation field that is also hidden, and call THAT :value to my text.
This is, obviously, less than ideal, so any help would be greatly appreciated!
Thank you, in advance!