Best way to build location page, post type or taxonomy?

Support General Best way to build location page, post type or taxonomy?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27381
    mailme@janpieters.nl[email protected]
    Participant

    Hi there,

    I have a woocommerce shop and have the following requirements:
    1) Add multiple locations (Amsterdam, Rotterdam, Utrecht) to the website from where the customers can purchase the products.
    2) I would like to add a taxonomy to woocommerce products to be able to filter the products on the location pages
    3) I would like to add the location name within the url structure.

    I would like to set up a page for each location with the following information:
    Business name (custom field)
    address (custom field)
    images of location (custom field)
    Most sold products (taxonomy filter)

    My question is: what would be the ideal solution to accomplish this? Should these location pages be a custom post? Or should it be a taxonomy archive (similar to woocommerce product category archive)?

    Furthermore: I would like to have the following url structure for the locations:

    For the location pages: website.nl/location_name
    website.nl/amsterdam
    website.nl/utrecht
    website.nl/denhaag

    For the product pages: website.nl/location_name/product_cat/product
    website.nl/amsterdam/rozes/red-rozes
    website.nl/utrecht/rozes/red-rozes

    For the product category archive pages: website.nl/location_name/product_cat/
    website.nl/amsterdam/rozes/ (only products with taxonomy in product checked)
    website.nl/utrecht/rozes/

    For the checkout pages: website.nl/location_name/checkout
    website.nl/amsterdam/rozes/checkout
    website.nl/utrecht/rozes/checkout

    So how can I add the custom post into the url structure?

    #27396
    Long NguyenLong Nguyen
    Moderator

    Hi Jan,

    I think you should use the custom taxonomy for the product instead of creating a custom post type and create a connection between 2 post types (product and location) with MB Relationships.

    Using the taxonomy, you also have the support of WordPress by using some built-in functions and easier to query posts.

    Regarding the permalink structure, a post type has the default permalink yoursite.com/cpt-slug/post-slug. If you want to customize the permalink for the CPT, please follow this topic
    https://wordpress.stackexchange.com/questions/94817/add-category-base-to-url-in-custom-post-type-taxonomy

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