Okay
  Public Ticket #2512173
How to add product subcategory in the breadcrumb for single product pages?
Closed

Comments

  • jfung started the conversation

    Hi,

    I would like to know how to add product subcategory into the breadcrumb in the single product pages.

    Currently, the breadcrumb goes like this:

    Home > Shop > Product.

    I would like to know how to add the product subcategory into the breadcrumb, so it will look like this:

    Home > Shop > Product sub-category > Product.

    Thanks!


    The website I need help with is here: https://summitdiamonds.com/product/10kt-gold-ring-copy/

  • jfung replied

    Additionally, It will be great if you can also provide the codes to add the parent product category as well, so I can have more flexibility to what will be showing at the end.

    Thanks!

  •  891
    TheFox replied

    Hello Jfung,

    You want to get the parent category and one of the sub category in the breadcrumbs?

    I think our devs can give you this customization easily.

    Confirm what you need, I think it even might be included in the next update.

    Best regards

  • jfung replied

    I have already confirmed what I need. It's exactly in the context of both my previous messages.

    1. Adding parent product category to the breadcrumb.

    2. Adding child product category to the breadcrumb.

    I don't want one piece of code that will display BOTH parent product category AND child category. I can use plugins like Yoast SEO for that purpose.

    I want one piece of code that will show the parent product category, and one piece of code that will show the child product category, so it's more flexible for me to choose if I want to just display the parent category or child category or even both at the end.

    I hope you can understand because I honestly don't know how to make it even easier to understand.

    Thanks.

  • jfung replied

    Actually, I managed to make it work with the Yoast SEO plugin, after having changed the structure of the product categories. 

    It is still not a full solution as I have to make compromises so I am still hoping that you guys can provide a solution for me.

    Thanks.

  •  891
    TheFox replied

    Hello Jfung,

    The sidebar category issue should be fixed.

    Now the Arrow make the drop down to open and the direct click to go to the cateogry.

    For the breadcrumbs, in case of multiple categories, how you would it to proceed, only to show the first selected one?

    Best regards

  • jfung replied

    Hi,

    thanks, I will check out those changes when I do maintenance and upgrades for the client on their website.

    As for the breadcrumb, I guess that can work.


    Instead of Yoast, I turned to copying the single product php and replacing the header with 

    <?php woocommerce_breadcrumb(); ?>

    provided by Woocommerce, and the woocommerce breadcrumbs plugin to edit the breadcrumbs.


    That being said, I still think that the theme's breadcrumb showing only "Home > Shop > Product" is still overly simple, with no other way to edit it (just on or off). Even Woocommerce's default breadcrumb is better. 


    Hope your theme will continue to improve.

    Thanks.