Jump to content

manufacturer with link in product.tpl


guest*

Recommended Posts

How can I get the manufacturers WITH Link to manufacturer page in product.tpl. I included this code, but don't know how can I build the link so when you click there you wil come to manufactuer page. I also want the manufacturer displayed underscored

<!--manufacturer -->

{l s='Hersteller'}: {$product->manufacturer_name|escape:'htmlall':'UTF-8'}

Link to comment
Share on other sites

Unfortunately, you can't access the manufacturer link from the product object, so you will need to add code to product.php to pass in the link. Change line 111 of product.php (in PrestaShop v1.3.2) from:

$product = new Product($id_product, true, intval($cookie->id_lang));



to:

$product = new Product($id_product, true, intval($cookie->id_lang));
$manufacturer = new Manufacturer($product->id_manufacturer, intval($cookie->id_lang));
$smarty->assign('manufacturer_link', $link->getManufacturerLink($manufacturer->id, $manufacturer->link_rewrite));



then you can use the following in product.tpl:

<!--manufacturer -->

{l s='Hersteller'}: <a href="{$manufacturer_link}">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 4 weeks later...
  • 1 month later...
  • 3 months later...
  • 2 months later...
  • 7 months later...
  • 8 months later...

For this upgrade in 1.5.3

edit product.tpl in your template

 

and change line 224 in :

 

 

<h2 itemprop="brand"><a href="{$link->getmanufacturerLink($product->id_manufacturer, $manufacturer.link_rewrite)|escape:'htmlall':'UTF-8'}">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</a></h2>

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

For this upgrade in 1.5.3

edit product.tpl in your template

<h2 itemprop="brand"><a href="{$link->getmanufacturerLink($product->id_manufacturer, $manufacturer.link_rewrite)|escape:'htmlall':'UTF-8'}">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</a></h2>

 

Merci pour ce tip, très utile et qui tombe à pic :)

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...