Permalinks for WooCommerce Categories and Subcategories



Desired permalink structure (only these structures exist for products)

Product 1: /shop/category/subcategory/product1/
Product 2: /shop/category/product2/

Woocommerce Product View Settings

View for shopbase:     Show categories
View for categories:   Show products


Products are only checked for one category OR subcategory

Permalink Settings

Normal settings:       /%category%/%postname%/
Base for categories:   shop
For products:          /shop/%product_cat%/


Since there are over 100 subcategories, I want to use an archive to list all 
the products.

Attempts to solve

With the below attempts I’ve been able to produce a working Product-page but while doing so, also 404:ing the subcategory page. I can’t recall which option produces what result.

  1. I have tried different permalink settings for the product categorybase, including %category%/%product_cat%, %category%/%product_cat%/%postname%, %product_cat%/%product_cat%, shop/%product_cat%, shop/%product_cat%/%postname%, and all those above combinations with an ending as /. as well
  2. I’ve tried swapping above with the base shop permalink setting.
  3. I’ve tried chaning Product View Settings to show subcategories instead of products.
  4. I’ve tried creating pages for the subcategories while having a working Product page, but the subcategory page still returns a 404.
  5. I’ve tried this SO attempt with no luck.

What am I doing wrong or what part can I rewire to make this work?
So greatful for any hints or leads or answers. Thank you for reading this!

, , , , Anton Flard 4 years 2018-01-13T18:02:41-05:00 0 Answers 88 views 0

Leave an answer