• Resolved acephalia

    (@acephalia)


    Hello, firstly thank you for the amazing work on this.

    I have setup a taxonomy pod that is linked to products. Works fine.

    The issue comes where all my other product categories follow a url structure of
    /shop/parent-category/child-category-1

    I have enabled url re-write in the pod settings however the url displays as : pod-name/pod-category
    Is there anyway I can get this to show as /shop/pod-category?

    If I add slug replacement in the settings and use ‘shop’ this works however it breaks all the other default woocommerce product categories then which return a 404.

    Ideally if the pod can just use the Product category base from the general permalink settings that would be fantastic.
    Thank you!

    • This topic was modified 6 months, 2 weeks ago by acephalia.
Viewing 1 replies (of 1 total)
  • Plugin Support Paul Clark

    (@pdclark)

    WordPress permalink are matched using a list of regular expressions which are matched in an order defined by their priority.

    Because changing the custom taxonomy to be prefixed by /shop/ causes the conflicting paths to return a 404, my suspicion is that the built-in URL structure is matching, but then not finding the custom taxonomy within the default product category terms.

    This is not an especially simple thing to resolve:

    • It may be that moving the custom taxonomy permalink rule to a higher priority will resolve the issue. This might also cause built-in product categories to 404. Testing this would require using a plugin like Query Monitor to see which rule is matching, then filtering the priorities.
    • A complex solution would be to deregister the product category default permalink rule as well as the custom taxonomy rules, then write a new rule which checks both taxonomies together.
    • A simple solution might be to extend the 404 template or use the 404_template filter to redirect to the default custom taxonomy URL if an expected URL is accessed under /shop/

    Each of these approaches gets technical very quickly. There may be a permalink plugin available, either for free or as a paid resource, which can handle the requirement, but generally one might need to find a system sophisticated enough to query two different taxonomies for a match within one URL structure, which usually requires unregistering the default permalink rules, then writing a custom rule which queries both taxonomies for a match to the requested URL.

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