1

I hope the image I'm posting help you understand what I'm trying to do.

I need to have a custom post type that will hold ads for selling stuff.

I will need to use the custom categories to filter results in many parts of the site. And will have to combine categories at some points.

Every sub-cat (bikes, accessories, vestuary and components) will have specific types, models and size. But they will also have brand and gender that are no specific to each one. That means that one brand can have products in bikes and vestuary. Same thing with gender, yuo can have a female bike model or a female accessory.

Now... On the page where the user will insert the ad, he will select some categories (with a HTML 'select'), therefore, I can't 'clog' all categories inside each other. Like we normally do:

Categories
    - Bikes
        - Types
            - Type A
            - Type B
            - Type C
        - Models
            - Model A
            - Model B
            - Model C
        - Size
    - Accessories
        - Types
            - Type D
            - Type F
            - Type G
        - Models
            - Model D
            - Model F
            - Model G
        - Size
    - Vestuary
        - Types
            - Type H
            - Type I
            - Type J
        - Models
            - Model H
            - Model I
            - Model J
        - Size
    - Components
        - Types
            - Type K
            - Type L
            - Type M
        - Models
            - Model K
            - Model L
            - Model M
        - Size

I can't seem to find a clean way of solving this. Do you guys have any idea?

Making custom taxonomy for every thing will make the admin a mess... And probably will cause a lot of confusion when the time comes to make the various and combine them to filter results.

I need to show to the user 4 for the following:

- Categories
- Types
- Models
- Size

Each subsequent will activate and show items that are conected with the previously selected one.

Ex.: I select 'bikes', and the next (for 'types'), will show the available types that are child of 'bikes'. And after selecting a type, the next (the 'models' one), will show the models, inside that selected type. And so on.

I need to find a way to show that correctly to the user. And the correct form to save it on the DB so I can filter it later.

Here is an image to 'illustrate' the structure I have:

enter image description here

2
  • What is your concern - how to present the data & selection process to the user, or how to build it so you'll have an easy time querying the products?
    – janh
    Oct 19, 2017 at 15:58
  • Both. I updated the question with that info. Oct 19, 2017 at 16:05

1 Answer 1

0

So, after some discussion in other forums, I searched for a plugin to help on the matter and after finding nothing useful, I decided to go other way.

Since it looks like WordPress can't handle this structure, I'm gonna do a workaround and explain it here because it might be helpfull to others.

MY SOLUTION:

  • I'm gonna create the CPT 'ads'
  • I'm gonna create the folowing taxonomies for the 'ads' CPT:

    • Bikes types
    • Bikes models
    • Bikes sizes
    • Accessories types
    • Accessories models
    • Accessories sizes Etc
  • I'm gonna hide all of them from the admin panel on the left.

  • I'm gonna make a page, inside the admin, with the permalink, so the admin can add or delete taxonomies.

That way, I can keep the interface clean and organized.

Your Answer

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

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