• Hi,

    I’m building an Events website with Woocommerce. The structure and relationship between the products/events and their Venues (where the event is taking place) is as follows:

    Event (Woocommerce Product CPT)
    Venue (Custom Taxonomy of Woocommerce Products CPT)

    However, I also need to group the Venues into Geographical locations such as North, South, Wales, Scotland so that venues can be filtered on the front-end by the visitor.

    At first I thought I could just create another custom taxonomy called Venue Locations. However, how would I assign a venue to a venue location?.
    Also thought of just making the Venue locations as parent terms for the Venues, so it would be like:

    North
    Venue 1
    Venue 2

    South
    Venue 3
    Venue 4

    However, a ‘Venue Location’ is not strictly a ‘Venue’ in itself so could cause issues when wanting to query the Venues taxonomy and display them on the front-end.

    Another option would may be create the ‘Venues’ as another CPT and then add the ‘Venue Locations’ as a custom taxonomy there. However, using 2 different CPTs seems over-complicated for something that appears quite simple.

    Keeping in mind that Events/Products will need to be assigned to a ‘Venue’ taxonomy term but not necessarily a ‘Venue Location’, what would be my best approach here?.

    Any guidance much appreciated.

    • This topic was modified 4 months, 1 week ago by andyt1980.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You could create term meta called venue_location and use it to assign locations to venues: https://developer.www.ads-software.com/reference/functions/register_term_meta/

    Keep in mind that you’d need to build the UI around that because WordPress doesn’t understand how to handle that custom data. I’m sure there are some existing plugins for managing this from a UI if you prefer.

    Thread Starter andyt1980

    (@andyt1980)

    Thank you, this could work and I could use ACF to add the Metafield as a select drop-down.
    Only issue with this approach is that the new Elementor Taxonomy filter which I’m using to display the venues on the front-end doesn’t support Taxonomy Term Metadata.
    However, I believe FacetWP or possibly other filtering plugins may support them.

    Would appreciate any other input as to whether using Taxonomy Term Metadata would be the best approach.

    Thanks.

    Based on the info you’ve provided, I believe term meta would be the ideal approach for the Venue Location.

    Where it becomes “not the right approach,” is when you need additional data for the Venue Location. For example, if you wanted an archive for it, while possible with term meta and custom code, it’s better to use a custom taxonomy. Or, if you needed Venue Locations to behave more like a post/page, a CPT would be a better option (and we’d be getting into post-to-post relationships).

    Basically, when I look at how I want to architect such projects, I like to look at the different data and the different ways it needs to be used for the site. So far, it seems you only need to be able to query by Venue Location, and if that’s all you ever need to do with it, term meta makes a lot of sense. The hurdle is just getting the UI and front-end features built either through a plugin or custom code.

    Thread Starter andyt1980

    (@andyt1980)

    Thank you, thats very helpful. There will be seperate pages on the site for Venue Locations, so for example there will be a page showing all ‘Venues’ in the ‘North’. I suspect creating that query with Elementor will be easier if Venues was a seperate CPT but I will see if I can achieve it using Term Meta.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.