• Resolved archesis

    (@anchises)


    I can display a Woocommerce product in browser by its ID by appending /?p=123
    For example: http://www.shop.com/?p=123

    I would like to do the same with product category, something like this: http://www.shop.com/?product_cat=123

    Reason: Slugs can be changed, which means the URL changes, which is bad for existing links, which are then broken. IDs stay the same, no matter if the slug is changed.

    What is the correct syntax to do this?

Viewing 1 replies (of 1 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    At the moment, WordPress core uses slugs (not IDs) for its permalinks – this isn’t something that WooCommerce has any direct control over unless you’re doing a custom loop in PHP, using a block, or adding a shortcode.

    For use in URL parameters, that means you only have the option of using the slug – e.g. https://wc.local/?product_cat=casual

Viewing 1 replies (of 1 total)
  • The topic ‘Display product category by ID’ is closed to new replies.