I'm using mathematical calculations native to PHP using the plugin code described in this post: https://toolset.com/forums/topic/math-with-custom-fields-values/
I have a View that pulls custom-fields from a related Parent post. The code works fine inside a view calculating fields in the queried post but I'd like to display the product of a custom-field in the loop and a custom-post in the parent post. It doesn't seem to work. I'm using this code:
[calculate round="2"][types field="cup-weight-ing" output="raw"]*[types field="quantity-1" output="raw" item="$post"][/types][/calculate]
I also tried it with this code: [calculate round="2"][types field="cup-weight-ing" output="raw"]*[types field='quantity-1' output='raw' item='@post-and-ingredient.parent'][/types][/calculate]
It only displays the field in the CPT that's queried in the loop.
Is it possible to compute a product pulling variables from both post types?
Thanks
My issue is resolved now. I reversed the order of the two fields, used the field "in the page where the view is shown" times the field in the loop and it worked.
Here is the code that worked: [calculate round="2"][types field='quantity-1' item='$current_page'][/types]*[types field="cup-weight-ing" output="raw"][/calculate]
Thanks!