I hope you can show me the way please. I will explain through an example which is easier. I have a custom post type "juicing_fruits", this post type has a few custom fields that are saved in an array:
custom 1 has a label "fruits" and contains the options: apple, pear, orange, cherry
custom 2 has a label "type" and contains the options: smoothie, juice, iced
custom 3 has a label "link" that is just a text for a URL.
The Categories available for the custom_type post are the merge of fruits and type, so: apple, pear, orange, cherry, smoothie, juice, iced.
The plugin that I am using for the custom type has a function that can return the custom fields values through an array in the following format
Array ( [fruits] => apple, orange[type] => juice, iced [link] => http://blablabla )
My aim is to automatically set the categories of a post, when this is saved/published, depending the fruits and type selected. So if for example the custom fields are like above (fruits: apple and orange, type: juice and iced) then the categories will be the same (apple, orange, juice, iced).
Hope this all make sense. Thank you in advance.