Calculating Amounts of selected Taxonomy fields
-
Imagine I have a post type called recipes and created a repeatable group called ingredients.
In this group, there are some basic fields like “numeric” amount and taxonomy select for units and ingredients.The taxonomy ingredients is part of the recipe post type. The taxonomy has some custom fields, a group nutritional_information with some numerical fields inside (fat, carbohydrates, calories, Proteine, etc.).
I want two reach to goals:
First:
I want to recaclulate the amount + unit selected to a fix unit. For example: if kg selected, i want to convert to 1000g. this can be done (i know). Then I need to sum up all these in a calculation field (can be done, i Know).But now there is the problem ??
Every ingredient taxonomy has fields, numeric. And I want to sum up these fields for the amount chosen in the recipe fields.
For example:
User choses:
200 g tomatoes
100 g sugar
2 g curry powder
tomatoe, sugar and curry powder are terms from the ingredients taxonomy. they have different values for nutritional information for 100G of each ingredient.My aim is: I want to get the values for 200g tomatoes, 100g sugar and 2g curry poweder summed up for my single recipe ??
- The topic ‘Calculating Amounts of selected Taxonomy fields’ is closed to new replies.