Last thing, how can i make it possible to use comma instead of dot, when typing a value with decimals?
For example the height will be entered as 2 * 3,2 (with comma instead of dot)
Hello. Thank you for contacting the Toolset support.
Do you mean that user will add value with comma and comma should be considered as desimal for both fields "Højde m2" and "Bredde m2"? will both field accept comma or any one of those?
Can you please tell me where you added the shortcode [wpv-calculate]?
Sometimes the user needs to calculate for example: 1.2 * 1.4 = 1.68
Instead of typing the dot, is it possible that the user is able to type the values like this: 1,2 * 1,4 = 1,68
I've moved the [wpv-calculate] shortcode form your theme's function.php file to "Custom Code" section offered by Toolset and I've adjusted the code as given under:
// Calculate shortcode
add_shortcode('wpv-calculate', 'calculate_shortcode');
function calculate_shortcode($atts) {
if((isset($_REQUEST['wpv-wpcf-folieprint-hojde']) and $_REQUEST['wpv-wpcf-folieprint-hojde']!='')
and
(isset($_REQUEST['wpv-wpcf-folieprint-bredde']) and $_REQUEST['wpv-wpcf-folieprint-bredde']!='')
) {
$hojde_val = str_replace(",",".",$_REQUEST['wpv-wpcf-folieprint-hojde']);
$bredde_val = str_replace(",",".",$_REQUEST['wpv-wpcf-folieprint-bredde']);
$result = $hojde_val * $bredde_val;
return str_replace(".",",",$result);
}
return 0;
}
You have to select the option "Full page refresh when clicking Submit" from "Custom Search" settings of your view as such custom thing is not working when you are using ajax view.