If you work with hierarchical categories (taxonomies) in WordPress, you will notice that, on the one hand, the display of the checked categories in the backend is confusing and, on the other hand, posts do not automatically end up in the parent category if they are placed in the child category. Both can be straightened out with just a few lines of code using the powerful hook system (in the form of an action and a filter).
Display without category selection (WordPress standard)
Display according to category selection (WordPress standard)
After the code adjustment, the parent category (manufacturer) is set and the tree representation is retained