emmeics Posted August 5, 2010 Share Posted August 5, 2010 Hi,i would transform the breadcrumb from Home > Cat 1 > Cat2 > Product in Home > Cat1 > Cat2. I have just tried to modify some classes but without results. Thanks for the answer. Link to comment Share on other sites More sharing options...
robkwal Posted August 12, 2010 Share Posted August 12, 2010 I would like to know how to achieve this too... Link to comment Share on other sites More sharing options...
rocky Posted August 13, 2010 Share Posted August 13, 2010 Try changing line 641 of classes/Tools.php from: return self::getPath($id_category, Category::hideCategoryPosition($category->name), true).''.$pipe.' '.htmlentities($end, ENT_NOQUOTES, 'UTF-8').''; to: return self::getPath($id_category, Category::hideCategoryPosition($category->name), true)/*.''.$pipe.' '.htmlentities($end, ENT_NOQUOTES, 'UTF-8').''*/; Link to comment Share on other sites More sharing options...
chrisxm Posted May 7, 2011 Share Posted May 7, 2011 Hi rocky,I tried to change my breadcrumb using your method on prestashop 1.4.1.0 but it doesn't work.before: return self::getPath($id_category, $category->name, true, $type_cat).''.$pipe.' class="navigation_product">'.htmlentities($end, ENT_NOQUOTES, 'UTF-8').''; after : return self::getPath($id_category, $category->name, true, $type_cat)/*.''.$pipe.' class="navigation_product">'.htmlentities($end, ENT_NOQUOTES, 'UTF-8').''*/; Do you have an idea, how to do it ?Chris Link to comment Share on other sites More sharing options...
xioup Posted July 20, 2011 Share Posted July 20, 2011 I'd like to figure this one out, too. Will report back when I find the solution.We're working on a shop with long category and product names, and I find that having the product name in the breadcrumb is redundant, especially when it's displayed again, just beneath the breadcrumb. Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 21, 2011 Share Posted July 21, 2011 Simply replace following line in controller->productController.php in prestashop v1.4+and in product.php in lower version 'path' => Tools::getPath((int)$category->id, $this->product->name, true), with the code 'path' => Tools::getPath((int)$category->id, '', true), 2 Link to comment Share on other sites More sharing options...
xioup Posted July 21, 2011 Share Posted July 21, 2011 The following instructions apply to PrestaShop 1.4.3.They have not been tested thoroughly, so there may be unknown side effects to making the following change - I will report back if I come across any negative side-effects.In Tools.php, change line 818 ( in function getPath() ) from this: return $fullPath.$path; To this: return $fullPath; Note: You'll end up with a trailing category pipe at the end of the breadcrumb.Note: For safety and upgrade reasons, you should use the /override/classes/ method for overriding / extending the original ToolsCore class. Link to comment Share on other sites More sharing options...
xioup Posted July 21, 2011 Share Posted July 21, 2011 Simply replace following line in controller->productController.php in prestashop v1.4+and in product.php in lower version Vivek, thanks for the help, but I think my method is better, since my change is localized to the code that's responsible for building the breadcrumb, whereas yours would affect any and all functions that rely on 'path'.Changes should be as localized as possible to minimize unwanted side-effects.KurtEdit: I retract my statement that my method is necessarily better than Vivek's. Tools::getPath() is called from three files in my PrestaShop 1.4.3 installation (CategoryController.php, ProductController.php, CMSController.php). My change will only affect the call from ProductController.php, due to the way the function is defined and how it is called from the other locations.However, it's possible that another PrestaShop configuration with additional or modified Controllers or with a different set of Modules could call Tools::getPath() and run into problems due to the change I suggested (possible, but I think highly unlikely, since Tools::getPath() creates an html string that's not likely to be used in any kind of calculation, query or appplication logic).I'll switch to Vivek's method and report back if I come across any problems with it. Link to comment Share on other sites More sharing options...
vivek tripathi Posted July 21, 2011 Share Posted July 21, 2011 Hi xioupits good alternative to remove title from bredcumbsince query is for product page and user simply want to remove from product page so I would preffer to change should be localised i.e. in product.phpinsted of change core class file Tool.php. I found that Tools::getpath function used at several places .it may effect others too.However its good alternative. thanks for suggestion and new method Link to comment Share on other sites More sharing options...
Swedutch Posted September 20, 2011 Share Posted September 20, 2011 Hi, I have done everything to get rid of the breadcrumb. Without any succes. Any other suggestions. Would be very glad!!! Link to comment Share on other sites More sharing options...
virtualgadjo Posted September 22, 2011 Share Posted September 22, 2011 hi, if you want to get rid of the breadcrumb you can - either empty breadcrumb.tpl - or erase {include file="$tpl_dir./breadcrumb.tpl"} in the templates you use have swing Link to comment Share on other sites More sharing options...
DARKF3D3 Posted August 28, 2014 Share Posted August 28, 2014 Someone know how can I do that on PS1.6? Link to comment Share on other sites More sharing options...
makler3d Posted October 30, 2014 Share Posted October 30, 2014 In prestashop v.1.6.0.9 copy /controllers/front/ProductController.php to /override/controllers/front/ and replace line 578 in /override/controllers/front/ProductController.php $path = Tools::getPath($this->category->id, $this->product->name, true); with the code $path = Tools::getPath($this->category->id, ' ', true); 1 Link to comment Share on other sites More sharing options...
DARKF3D3 Posted October 31, 2014 Share Posted October 31, 2014 Thanks makler Link to comment Share on other sites More sharing options...
JMeghval Posted August 27, 2015 Share Posted August 27, 2015 To remove the categories title you have to go to themes/category.tpl <h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}">{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)} {$categoryNameComplement|escape:'html':'UTF-8'}{/if} {include file="$tpl_dir./category-count.tpl"} </h1> Find these line in your themes and remove these lines . Link to comment Share on other sites More sharing options...
vekia Posted August 27, 2015 Share Posted August 27, 2015 but it removes the H1 tag not the category name from breadcrumb Link to comment Share on other sites More sharing options...
mipresente Posted August 3, 2017 Share Posted August 3, 2017 At CSS level this worked for me: #columns > div.breadcrumb.clearfix > li:last-child { display:none; } ps: I added this at the end of product.css of my theme. Link to comment Share on other sites More sharing options...
obewanz Posted August 16, 2017 Share Posted August 16, 2017 (edited) If you already have an /override/controllers/front/ProductController.php file (my shop does because of my theme) then you can do something like the following: my original theme override ProductController.php looks like: class ProductController extends ProductControllerCore { /* * module: stoverride * date: 2016-03-01 21:21:12 * version: 1.0 */ public function initContent() { parent::initContent(); if(Configuration::get('STSN_PRODUCT_SECONDARY')) $this->context->smarty->assign(array( 'HOOK_PRODUCT_SECONDARY_COLUMN' => Hook::exec('displayProductSecondaryColumn'), )); } } Before the last } in the file insert the category template vars code: class ProductController extends ProductControllerCore { /* * module: stoverride * date: 2016-03-01 21:21:12 * version: 1.0 */ public function initContent() { parent::initContent(); if(Configuration::get('STSN_PRODUCT_SECONDARY')) $this->context->smarty->assign(array( 'HOOK_PRODUCT_SECONDARY_COLUMN' => Hook::exec('displayProductSecondaryColumn'), )); } /** * Assign template vars related to category */ protected function assignCategory() { // Assign category to the template if ($this->category !== false && Validate::isLoadedObject($this->category) && $this->category->inShop() && $this->category->isAssociatedToShop()) { /* remove product name from breadcrumb */ //$path = Tools::getPath($this->category->id, $this->product->name, true); $path = Tools::getPath($this->category->id, '', true); } elseif (Category::inShopStatic($this->product->id_category_default, $this->context->shop)) { $this->category = new Category((int)$this->product->id_category_default, (int)$this->context->language->id); if (Validate::isLoadedObject($this->category) && $this->category->active && $this->category->isAssociatedToShop()) { $path = Tools::getPath((int)$this->product->id_category_default, $this->product->name); } } if (!isset($path) || !$path) { $path = Tools::getPath((int)$this->context->shop->id_category, $this->product->name); } $sub_categories = array(); if (Validate::isLoadedObject($this->category)) { $sub_categories = $this->category->getSubCategories($this->context->language->id, true); // various assignements before Hook::exec $this->context->smarty->assign(array( 'path' => $path, 'category' => $this->category, 'subCategories' => $sub_categories, 'id_category_current' => (int)$this->category->id, 'id_category_parent' => (int)$this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->getFieldByLang('name')), 'categories' => Category::getHomeCategories($this->context->language->id, true, (int)$this->context->shop->id) )); } $this->context->smarty->assign(array('HOOK_PRODUCT_FOOTER' => Hook::exec('displayFooterProduct', array('product' => $this->product, 'category' => $this->category)))); } } Edited August 16, 2017 by obewanz (see edit history) Link to comment Share on other sites More sharing options...
lukash4 Posted February 9, 2021 Share Posted February 9, 2021 On 10/30/2014 at 8:14 PM, makler3d said: In prestashop v.1.6.0.9 copy /controllers/front/ProductController.php to /override/controllers/front/ and replace line 578 in /override/controllers/front/ProductController.php $path = Tools::getPath($this->category->id, $this->product->name, true); with the code $path = Tools::getPath($this->category->id, ' ', true); Thanks, it works - but how do I get rid of the last arrow after the category name? Home > Cat 1 > Cat2 > 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