Skip Navigation

[Resolved] do a calculate in a view

This support ticket is created 2 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 2 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2330421

Tell us what you are trying to do?
I need to calculate field1*field2 and display the results.

Is there any documentation that you are following?

I tried https://toolset.com/forums/topic/calculator/
but I keep getting an error.

Parse error: syntax error, unexpected 'to' (T_STRING), expecting ';' in /home/customer/www/capitalmobilizer.com/public_html/demo/wp-content/themes/genesis-sample/functions.php(278) : eval()'d code on line 1

Is there a similar example that we can see?

What is the link to your site?

hidden link

#2330593

Hello,

How do you display the custom shortcodes, there should not be other string value "to" within the [wpv-calculate] ... [/wpv-calculate] shortcode.

I suggest you output the custom field values directly, without [wpv-calculate] shortcode, make sure the calculation formular are valid, for example:

[types field="field-slug-1"][/types]*[types field="field-slug-1"][/types]