Skip Navigation

[Resolved] calculations

This support ticket is created 4 years, 9 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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 4 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1575653

Hi

I am building a site where each custom post type contains a price.
Each user can publish several posts and on each post the user enters a price.

I need to show each user the total price of all his posts.
How can I do the math to calculate price1+price2+...+priceX ?

Thanks in advance
Eric

#1577027

Hi Eric,

Thank you for contacting us and I'd be happy to assist.

To achieve this you'll need two components:

1. A post view that shows all posts by a currently logged-in user, that outputs only the comma-separated list of all price custom field values.

2. A custom shortcode that gets those values and shows the sum.

You'll find more detailed steps and example code snippet in this reply:
https://toolset.com/forums/topic/shortcode-for-showing-todays-date/#post-1426137
( in point 2 )

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar