Skip Navigation

[Resolved] Custom Shop Base with Custom Category for Woocommerce

This thread is resolved. Here is a description of the problem and solution.

Problem:

I wanted to change the URL structure for SEo purposes so that the category base is the same as the store base (which is /store/) . I understand that this is unconventional and advised against... but I need the URLS to be in the form of

domain.com/store/custom-category/custom-subcategory/product-slug

Solution:

There isn't such a built-in feature within Toolset, even within WordPress core, you might consider custom codes.

Relevant Documentation:

https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by nedG 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1198964
csdoorpermalink.jpg

I seem to have dug myself a bit of a hole and I don't know how to get out... or even if I can.

I have an online store and i have built it entirely using TOOLSET and WOOCOMMERCE. (The domain is not registered so if you would like access to it, you would need to edit your local hosts file on your PC to point it to the correct IP. I can send you the details in a PM)

In any case, I didn't like the fact that I couldn't edit and manage the built in Woocommerce Product Categories like I wanted to.. so I decided to use TOOLSET to implement and use my own custom Product Taxonomy (called Product Categories Custom) and I decided to discard the built in Woocommerce product categories. I couldn't "delete" the default Woocommerce product categories taxonomy, so I just decided not to use it at all.

I assumed it would be a simple thing to do to re-assign the products to a different "default" category. So I went into the Permalinks and noticed that it was using /store/%product_cat%/ as the custom product base.

Obviously the dynamic slug of %product_cat% is referring to the default Woocommerce categories (which I was not using).

How do I change that to use my own custom taxonomy? and will that change the "default" taxonomy for all products to my custom taxonomy??

Secondly, to make things even more interesting (and complicated), I wanted to change the URL structure for SEo purposes so that the category base is the same as the store base (which is /store/) . I understand that this is unconventional and advised against... but I need the URLS to be in the form of

domain.com/store/custom-category/custom-subcategory/product-slug

I have seen plugins do this... like this one... hidden link but I think it all revolves around using the default %product_cat%... not a custom taxonomy. Soooo... it seems I need to solve Part #1 above before I can solve Part #2.

I hope you can understand my situation.

Any guidance is appreciated.

#1198993

Hello,

There isn't such a built-in feature within Toolset, even within WordPress core, you can not setup the post permalink as you mentioned above directly:

domain.com/custom-category/custom-subcategory-1/post-a-slug
domain.com/custom-category/custom-subcategory-2/post-b-slug

You might consider custom codes, for example:
https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

But we don't provide custom codes support, you can check it with our Toolset contractors:
https://toolset.com/contractors/

#1243320

My issue is resolved now. Thank you!