0

I am working on a theme which has options for suit & shirt designing. Basically, I am stuck in creating taxonomies for suits & shirts.

Reference Link

Problem I am facing is to plan how the taxonomies should go: e.g.

  1. type:
    • suit
      • jacket
        • style & measurement options
      • trouser
        • style & measurement options
    • shirt
      • style & measurement options

now this is something in my mind, but there are also some things to think of, when I will select a suit and go for jacket options or trouser options, I have to load image for each style option and show the user how the finished product will look like.

Any suggestions will be appreciated as all these options are required to be configurable from admin panel.

2
  • 1
    Why do you want to use just one taxonomy? Style sounds like a good candidate for a second taxonomy, measurements are probably post meta data.
    – fuxia
    Sep 1, 2012 at 12:39
  • @toscho: thanks for the suggestion, but there will be different options for measurements and which have to be defined through taxonomy, I guess so, what do you suggest? e.g. trouser length will be a dropdown having different values e.g. 28" upto 55". Sep 2, 2012 at 6:29

1 Answer 1

1

Taxonomies in WordPress don’t work like in biology or similar fields. They are not mutually exclusive. There are some ways to simulate such a behavior (see post formats for an example), but in general you have to expect cases where on post object belongs to more than one taxon (term). And there is no really useful sorting for taxons of the same level.

You can use a taxonomy for data that are hierarchical and mutually exclusive. But very often it is better to use a hierarchical custom post type and the Posts 2 Posts plugin. Unfortunately, there is no built-in equivalent in WP.

Then there are post meta data. Not hierarchical, easy to sort, bot no meta for the meta. :)

Don’t let you guide by the expected menu order when you assign taxonomies or other meta data. Building a menu structure (the view) should be kept a separate problem. You don’t want to change all these data when you decide to change the menu.

My suggestion: Use a hierarchical taxonomy for data that are similar and really from the same hierarchy. Use post meta for everything you have to compare: geo data, on/off values … if you need a radio button it is probably not a taxonomy.

Do use a taxonomy for cases where you may want to assign multiple values: color, layout position, topic.

When I create my post objects I try to eliminate some options first: How would I do that without custom taxonomies? Without post meta data? Without custom post types? How would my queries look like? Then I find step by step what is really necessary.

For your special case I would use a hierarchical taxonomy for the type (jacket, shirt) unless I need a lot of meta data. There is still no real meta data support in WordPress. Then I would use custom post types.
For colors, material and anything else that doesn’t have to be sortable (features) I would probably use flat taxonomies. One item might be available in multiple sizes … could be a taxonomy too.
And countable or sortable properties are post meta data: weight, amount of available items, washing temperature (correct word?), article number, on sale etc.

3
  • can you assist me if i use woocommerce & woostore(theme), is it possible to get the referred site's features to be setup using woocommerce? Sep 6, 2012 at 6:30
  • Sorry, I have no experience with WooCommerce.
    – fuxia
    Sep 6, 2012 at 6:36
  • any other framework/plugin that you can refer me to... thanks in advance Sep 6, 2012 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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