Woocommerce provides additional settings for its plugin in Settings-> Permalinks, in a section similar to the standard wordpress settings entitled ‘Product Permalinks’
Shop base https://mysite/shop/sample-product/
Shop base with category https://mysite/shop/product-category/sample-product/
as choices. I have tried Shop base, but it seems to give inconsistent results as I remember from local install, sometimes showing Shop-> Products->item instead of just Shop-> item, so I left at Standard for the live install. Shop and Products are the same address.
With this setting you get (navigating through the various pages) Home->Products->Music->Albums until you take the next step to single- product when you revert to Home->Products->Woo Album #2 instead of desired Home->Products->Music->Albums->Woo Album #2
I presume using the ‘Shop base with category’ option will give the desired results, but if I change to that now, it breaks things giving 404’s.
Is there a way to do this and repoint the addresses. A plugin I looked at offers a link by link repair, but I thought there might be a simpler way with htaccess file.
I think that if I left the change until when I tip out all the sample data, any new products added would be fine anyway?
We’re really talking about 2 different things here: 1) WooCommerce permalinks and 2) Breadcrumbs.
For #1, that’s outside of what I can probably help with. Dealing with permalink issues is something you’ll need to bring directly to the plugin author. My only suggestion is to visit Settings > Permalinks in the admin (only visit; no need to save). What this does is flush your rewrite rules. It could help.
For #2, we can do breadcrumbs however you want with Breadcrumb Trail. I just need a link to one of your product pages for reference and to know exactly how you want the trail to be set up.
What this does is flush your rewrite rules magic :), you learn more everyday. I suppose, being so simple most people know this.
we can do breadcrumbs however you want with Breadcrumb Trail great. I had it in my head that permalinks somehow governed the breadcrumbs. (now set to /shop/theme-category/sample-product)
At the moment, when at the Shop page https://amazingmomentscq.com.au/shop/ the breadcrumbs are Home->Shop->Products; Shop and products are the same address. Home->Shop would be good. I think ‘Products’ is Woo custom post type.
Further into the shop, at https://amazingmomentscq.com.au/shop/theme-category/sample-product/woo-album-1/
It would be good if the breadcrumbs could be Home->Shop->Music->Albums->Woo Album#1
which is equivalent to Home->Shop->theme-category->sub-category->single-product
Post Type is: product
Product categories: product_cat
Product tags: product_tag
Shop is a blank page Woocommerce creates on plugin install.
In their words: “This is the base page of your shop – this is where your product archive will be.”
The template used to display the page is archive-product.php. The page can be edited like any page, and content added will be will displayed above the content woo adds (categories of products or products or both )
This is working to this step in getting to the single product Home->Products->Music->Albums
both ‘Music’ and ‘Albums’ are categories (product_cat). ‘Albums’ is child category of ‘Music’.
When you go to Home->Products->Music->Albums->Woo Album #1
(Woo Album #1 is a single product) the Breadcrumbs go to Home>Products>Music>Woo Album #1
leaving out ‘Albums’
I’ve been reading https://github.com/justintadlock/breadcrumb-trail/blob/master/inc/breadcrumbs.php
and the part
// If the taxonomy is hierarchical, list its parent terms.
// Add the term name to the trail end.
and hope this means the trail can be set to display Home->Products->Music->Albums->Woo Album #1
I think I see the issue and why “Albums” is being left out. It’s because you’ve selected both the “Music” and “Albums” categories. If you simply select “Albums”, it should work correctly.
The problem is that there’s really no good way for Breadcrumb Trail to know which category is the “priority” (for lack of a better word). So, what it’s going to do is pick the first category with the categories sorted by ID.