Jump to content

Display the categories in breadcrumb from search query?


5haun
 Share

Recommended Posts

Hello everyone,

 

How do I display the categories for a product in the breadcrumb from a search?

 

It showing like this right now when I click on a product from a search:

xmlZpsM.jpg

 

If I click on a product directly from the categories it shows like this:

FiFEyj1.jpg

That's how I want it to display.

 

Any help or suggestions will be greatly appreciated!

Share this post


Link to post
Share on other sites

  • 3 months later...

You could use the function: (In classes/Product.php)

/**
* Get list of parent categories
*
* @since 1.5.0
* @param int $id_lang
* @return array
*/
public function getParentCategories($id_lang = null)
 
 
To get the 'parents' (i.e. category path from Home -> Product). Then build the breadcrumb out of it. Probably in controllers/front/SearchController.php
 
My 2 cents,
pascal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More