Skip Navigation

[Resolved] Calculation within View

This support ticket is created 3 years, 6 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.

This topic contains 2 replies, has 2 voices.

Last updated by kelvinL-2 3 years, 5 months ago.

Author
Posts
#2152575

Dear Sir/Madam,

I visit https://toolset.com/forums/topic/calculating-from-a-custom-field-and-a-view/ but not what I am looking for, is it possible to do basic Mathematics calculation within the Views.

I have custom fields contain value inside, for example cost, I want to build a View to list out of selected post and sum up the value from the custom field and then display as total on page.

Can Toolset able to do or I have to do with PHP global variables?

Best regards,

Kelvin.

#2152863

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kelvin

Toolset doesn't include any feature that you can use for calculations, and you'll need to use custom code for that.

How you do that depends on whether you want to add up values from fields belonging to the same post, or you want to calculate a sum across a number of posts.

You might find these couple of code samples helpful (even if they are not specifically the same case):

hidden link
hidden link

(That site has some code formatting issues, but you can hopefully understand the examples.)

#2159705

My issue is resolved now. Thank you!