evilnick Posted August 6, 2010 Share Posted August 6, 2010 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.BagsBags->GucciBags->LVHowever 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 SpeederIs 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 More sharing options...
rocky Posted August 7, 2010 Share Posted August 7, 2010 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 More sharing options...
evilnick Posted August 11, 2010 Author Share Posted August 11, 2010 Thanks for your reply rocky. But after doing the above mentioned changes, I got a message in the frontend which says "Hack attempt". Any ideas how to go about fixing this? Link to comment Share on other sites More sharing options...
evilnick Posted August 11, 2010 Author Share Posted August 11, 2010 UPDATE:I think I discovered a bug here.It seems that the product class doesn't have this attribute "$product->id_default_category", it should be "$product->id_category_default". Link to comment Share on other sites More sharing options...
rocky Posted August 11, 2010 Share Posted August 11, 2010 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 More sharing options...
evilnick Posted August 11, 2010 Author Share Posted August 11, 2010 Thanks! Reported the bug at http://www.prestashop.com/bug_tracker/view/5177/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now