0

In short, I have a site that offers products in several different stores. Each store is associated with a particular school. Since each school has its own school colors, many products are only available in certain colors in certain school.

For example, given a particular T-shirt, we would want to offer that T-shirt in red, white and blue at School A, red, green and blue at School B, etc.

Assigning colors and schools separately won't satisfy the requirement, unfortunately. Is there a way to assign taxonomies to a post in this way? As in check the School taxonomy first, then assign colors from the color taxonomy to that particular school taxonomy?

0

Essentially your issue is that you have extra data specific to the term and WP doesn't natively store such data.

On top of my head the low hanging ways to make it would be:

  1. Maintain the list of schools/colors and whenever school term is assigned automatically assign respective colors by code.
  2. Create term metadata tables (which would work via regular Metadata API, just not provided natively, there are plugins that take care of setup) and store information about colors as meta information in school terms, retrieving as necessary.

However if this is just one case of many similar requirements, you may want to implement schools as custom post types and add post relationships implementation to handle connections. Taxonomies are by nature grouping mechanism and aren't engineered to be data–heavy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.