robbie007 Posted February 22, 2014 Share Posted February 22, 2014 Hi, I want to add the manufacturer link to the breadcrumb for the page product.tpl Does anybody have an idea how to do that? Changing the URL-structure is not an option anymore. Thanks, Robert Link to comment Share on other sites More sharing options...
gergoo Posted June 21, 2016 Share Posted June 21, 2016 well, two years late, but it can still help to someone:-) you have to create an override to the productcontroller and put this code there: protected function assignCategory() { parent::assignCategory(); $navigation_pipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>'); $manufacturer_breadcrumb = '<a href="'.$this->context->link->getManufacturerLink($this->product->id_manufacturer).'">'.Manufacturer::getNameById($this->product->id_manufacturer).'</a><span class="navigation-pipe">'.$navigation_pipe.'</span>'; // Assign category to the template if ($this->category !== false && Validate::isLoadedObject($this->category) && $this->category->inShop() && $this->category->isAssociatedToShop()) { $path = Tools::getPath($this->category->id, $manufacturer_breadcrumb.$this->product->name, 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, $manufacturer_breadcrumb.$this->product->name); } } if (!isset($path) || !$path) { $path = Tools::getPath((int)$this->context->shop->id_category, $manufacturer_breadcrumb.$this->product->name); } if (Validate::isLoadedObject($this->category)) { $this->context->smarty->assign(array( 'path' => $path )); } } 1 Link to comment Share on other sites More sharing options...
Gev777 Posted July 18, 2016 Share Posted July 18, 2016 you have to create an override Hello gergoo I'm newbie in prestashop and didn't understand exactly how I will create. Could you please explain a bit detailed. Thx Link to comment Share on other sites More sharing options...
Azoda.net Posted July 29, 2016 Share Posted July 29, 2016 Hello gergoo I'm newbie in prestashop and didn't understand exactly how I will create. Could you please explain a bit detailed. Thx controllers/front/productcontroller.php you should search this words protected function assignCategory() { then do like that 2 Link to comment Share on other sites More sharing options...
Recommended Posts