Jump to content

[SOLVED] Category / Breadcrumb Problem


Recommended Posts

Hi mates,

I notice from this thread: http://www.prestashop.com/forums/viewthread/35755/P15/general_discussion/solved_breadcrumb_in_header_not_working
"if you put a product in multiple categories and click on the product from each of these categories, it will display the category you came from in the breadcrumb. It is only if you go to the product directly without going through the category list that it uses the default category."

I have a Bags category which will list all the products. Under this Bags category, there are a few sub categories, "Gucci", "LV".
e.g.
Bags
Bags->Gucci
Bags->LV

However when I clicked on the product from Bags, I do not want the breadcrumb to be Bags -> LV Monogram Speeder. I want the breadcrumbs to show the full path: Bags -> LV -> LV Monogram Speeder

Is there anyway to force it to use the default category?

Note: I have been playing with the $currentCategoryId, but I am not sure how to go about forcing it to choose the default category.

Please help. Thanks :)

Link to comment
Share on other sites

Try changing line 185 of product.php (in PrestaShop v1.3.1) from:

'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_default_category), $product->name))



to:

'path' => /*((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : */Tools::getFullPath(intval($product->id_default_category), $product->name)/*)*/

Link to comment
Share on other sites

That's right. You've found a bug in PrestaShop. You should report on the bug tracker that line 185 of product.php in PrestaShop v1.3.1 should be changed from:

'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_default_category), $product->name))



to:

'path' => ((isset($category->id) AND $category->id) ? Tools::getFullPath(intval($category->id), $product->name) : Tools::getFullPath(intval($product->id_category_default), $product->name))

Link to comment
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
×
×
  • Create New...