Best way of getting WooCommerce category path

enter image description here

If I am on a product or any category/subcategory I want to display a complete path to the topmost category.
Does WooCommerce already have a function for it or do I need to make my own loop that goes from child to parent?
Should I use $wp_query->get_queried_object()?
What is the best code for it?

Example:

Read more here:: Best way of getting WooCommerce category path

Leave a Reply

Your email address will not be published. Required fields are marked *