Skip Navigation

[Resolved] How to calculate two custom fields and output to another custom field?

This support ticket is created 4 years, 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 19 replies, has 2 voices.

Last updated by StanleyT8485 4 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1757713

Would you be able to display the calculated amount in a test custom field?

#1757719

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

sorry - I'm confused now. You told me that you want to display the calculated amount with view.

Where you applied the formula you shared?
[wpv-calculate][types field='ticker-price' output='raw'][/types]+[wpv-view name="test-price-to-book-fy20"][/wpv-calculate]

At what place i should add this formula and display the calculation?

#1758603

The formula is on this page: hidden link
You can add the formula on that page.

Here is a quick summary of what I'm looking to achieve.

I want to perform calculations on a custom field of a Parent post with a custom field from a Child post.

In this example, it is:
Ticker price (Parent post) - [types field='ticker-price' output='raw'][/types]
NTA per share (Child post) - [types field='nta-per-share'][/types]

A solution I found is putting the ID attribute into the custom field of the Child post like this [types field='nta-per-share' item='32'][/types]. However, I don't want that because this formula will be placed in a Content Template and used in multiple pages.

Hope that clear somethings up.

Sorry about the confusion.

#1758709

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please try to use the formula as given under:

[wpv-calculate][types field='ticker-price' output='raw'][/types]/[wpv-view name="test-price-to-book-fy20" wpvrelatedto="[wpv-post-id]"][/wpv-calculate]

Also, Edit your following view:
=> hidden link
And set the checkbox "Disable the wrapping DIV around the View" available just under the Loop template.

#1758747

My issue is resolved now. Thank you!