Hi Waqar,
Is there a way to sort a calculated field?
I have created a shortcode called [wpv-calculate] and I am using that to perform the calculation.
Next, I used the calculation in Views. For e.g. [wpv-calculate][types field='price'][/types]/[types field='quantity'][/types][/wpv-calculate]
I want to be sort this calculation in Views in both the back-end and front-end.
Is this possible?
Hi Stanley,
As discussed, I've set your next reply, so that you can share your localhost website's duplicator package and the details about the view with the custom shortcode and the sorting.
regards,
Waqar
Hi Stanley,
Thank you for sharing the duplicator package.
The way built-in table sorting works, it can function based on the single saved field value and can't recognize the computed final value that is shown in the output.
A better way to include a table sorting functionality, in this case, would be to stop using Toolset View's own sorting feature and use a third-party table sorter script, which doesn't involve, database queries.
You'll find the details about this approach in this support thread, specifically this reply:
https://toolset.com/forums/topic/sorting-nested-tables/page/2/#post-1175110
Note: these are the links that were shared in that reply:
hidden link
hidden link
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thanks Waqar for the links. I used tablesorter and it is amazing!