Jump to content

How to display Default Category in Breadcrumb?


Recommended Posts

Hi all,

I want to show the full path of the product in the Breadcrump, regardless of the category you enter.

 

To explain a little better.

I am using 3 levels of categories and most products are in 2 categories, and the default category is the third level.

The thing about Prestashop is that if I am in the category of level 2 and go to a product, breadcrump shows me the path of the second level category.

I want make whenever I enter a product, Breadcrump showing the complete route is the default category for that product.

I know this could be modified in ProductController.php maybe this line:

'path' => Tools::getPath((int)$category->id, $this->product->name, true),

But do not know much php.

Link to comment
Share on other sites

  • 2 weeks later...

Well the problem with breadcrumb is all time show the path where did you get.

For example if i have a product in default category (cat1 -> subcat1 -> thirdsubcat1) and i show this product in home, when customer intro yo see this product from home featured, the breadcrumb show (home -> Name Product) but the really default category is:

Home -> cat1 -> subcat1 -> thirdsubcat1 -> Name Product

Then I want to show this breadcrump regardless from where you clicked to see the product.

Link to comment
Share on other sites

  • 1 month later...

but what you're asking isn;t a breadcrumb trail, its a category structure.

 

If you place a product in home, then it is viewable via featured products etc on the homepage. Therefore, the last page visited would be home, NOT the category.

 

Why is this a concern to you anyway?

Link to comment
Share on other sites

  • 2 months later...

i've got the same issue

 

i want to show full breadcrumb for some product even if it's in home category too.

 

when i go to product page from some category there's home - category - product breadcrumb

but when i go to product from home - there's only home - product.

 

i want first case. how to do this?

Link to comment
Share on other sites

  • 6 months later...

but thats not a breadcrumb ! thats a category structure...

A breadcrumb is a list of link showing where the user has been... not a list of links reflecting the category structure. Ie if a user gets to the product directly from a homepage link, the the breadcrumb 'home > product' is correct... ie the user has left a trail of links behind them.

 

I can understand what you're asking, but thats not how breadcrumbs work.

Link to comment
Share on other sites

×
×
  • Create New...