Jump to content

Show manufacturer in product listing


ChrisU2R
 Share

Recommended Posts

I'm very new to modifying php code and can at best paste new code into existing without really knowing how it works. (Gotta start somewhere).

My problem is that I would like to display product manufacturers within the product listing rather than having to include it within each product title. From what I have found out so far I need to modify the product.tpl in my theme but have no idea what to change. Can anyone suggest an answer ? (I saw this discussed in another thread but could make no sense of it)

Any help very appreciated.

Share this post


Link to post
Share on other sites

Here is an example to include manufacturer in product.tpl to appear on the same line as the product name.


   {$product->name|escape:'htmlall':'UTF-8'}
({$product->manufacturer_name|escape:'htmlall':'UTF-8'})



Also include within the product listing:

{$product.manufacturer_name|escape:'htmlall':'UTF-8'}



hope that helps ;)

  • Like 2

Share this post


Link to post
Share on other sites

Thanks this worked! But how can I display the manufacturers image, instead of the name?

I tried ({$product->manufacturer_image|escape:'htmlall':'UTF-8'})
manufacturer_img
img_manufacturer

nothing worked... I appreciate your thoughts

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 1 month later...
Here is an example to include manufacturer in product.tpl to appear on the same line as the product name.


   {$product->name|escape:'htmlall':'UTF-8'}
({$product->manufacturer_name|escape:'htmlall':'UTF-8'})



Also include within the product listing:

{$product.manufacturer_name|escape:'htmlall':'UTF-8'}



hope that helps ;)



Hi, is it possible that the manufacturer would be clickable and by clicking the manucaturer, his page would show (all his products)? Thanks for help.

Share this post


Link to post
Share on other sites

Thanks this worked! But how can I display the manufacturers image, instead of the name?

I tried ({$product->manufacturer_image|escape:'htmlall':'UTF-8'})
manufacturer_img
img_manufacturer

nothing worked... I appreciate your thoughts

Looking at a previous example in the code, I would suspect something like
getImageLink($product->link_rewrite, $product->manufacturer_image, 'large')}"


Edit: after the img tag, there shoud be: s r c = " { $ l i n k - (inserted spaces so that hopefully it will show up...)

As for links, I use

{l s='Manufacturer'}:
getmanufacturerLink($product->id_manufacturer, $product->link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List items made by'} {$product->manufacturer_name|escape:'htmlall':'UTF-8'}">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}


Edit: after the a tag, there should be: h r e f = " { $ l i n k - (inserted spaces so that hopefully it will show up...)
which produce a list of all items by that manufacturer.

/Mats

Share this post


Link to post
Share on other sites

Thank you for the answer, but because of my lack of knowledge I was unable to got it work. Where should I put the code?



   {$product->name|escape:'htmlall':'UTF-8'}
({$product->manufacturer_name|escape:'htmlall':'UTF-8'}) 
   {if $confirmation}


       {$confirmation}

   {/if

Share this post


Link to post
Share on other sites

  • 4 months later...

Hi,

I would like to display the Manufacturer Name on the shopping cart details during the check out.

I used the code from this post, but if it displays on the product page, it doesn't work on the checkout page (file: shopping-cart-product-line.tpl).

Would you have any why?

Thank you,

Johanna

Share this post


Link to post
Share on other sites

  • 3 months later...

shit!!

i make somethink that:

    {if $product.id_manufacturer > 0}


         {if $manufacturer->name == ""}  

getmanufacturerLink($product.id_manufacturer, $manufacturer.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">



         {else}

getmanufacturerLink($product.id_manufacturer, $manufacturer->link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">



         {/if}

    {else}



    {/if}



and not good rewrite me manucafture when im in category some idea how fix it??

Share this post


Link to post
Share on other sites

  • 1 year later...

Thanks all...

Here is an example to include manufacturer in product.tpl to appear on the same line as the product name.

 

[b]	
	{$product->name|escape:'htmlall':'UTF-8'}
	({$product->manufacturer_name|escape:'htmlall':'UTF-8'})[/b]


 

Also include within the product listing:

 


[b]	{$product.manufacturer_name|escape:'htmlall':'UTF-8'}[/b]


 

hope that helps ;)

 

Thanks.... it worked like a charm

Share this post


Link to post
Share on other sites

  • 3 months later...
  • 5 weeks later...

This is a great customization!

 

I'm using PS 1.5.3.1 and I've managed to get the manufacturer's name to show only if a product has a manufacturer already assigned to it, here's the code if anyone wants to try it:

 

{if $product_manufacturer->name}{l s='Manufacturer'}: {$product->manufacturer_name|escape:'htmlall':'UTF-8'}{/if}

 

However I'd like to make the manufacturer_name part to be a clickable link to all products by that manufacturer as well. I can see that it would need to be similar to the code example given by mohsart a few posts up, but I have no idea what it would actually be (I'm not very good with stuff like this). Can anyone suggest something I could copy/paste and try out? Thanks in advance. :)

 

Elaine

  • Like 1

Share this post


Link to post
Share on other sites

Try this:

{if isset ($product.manufacturer_name)}<h3><a href="{$link->getmanufacturerLink($product.id_manufacturer, $product.id_manufacturer)}" title="{$product.manufacturer_name}">{$product.manufacturer_name}</a></h3>{/if}

Share this post


Link to post
Share on other sites

Thanks sebkos, but something about that isn't right, it broke the whole page (just went blank).

 

Edit: whoops, my bad, overwrote the whole line. Still, now having put the code in the *right* spot, it didn't change anything. The manufacturer's name didn't turn into a link. Not sure what's wrong there.

Edited by artofadornment (see edit history)

Share this post


Link to post
Share on other sites

Hi

 

that is really a nice contribution.

 

I am working on a way to insert a new img/logo into the product_list addional but of the like as the 'new' or 'sale' img.

 

The ppoint is, I sell items that are tested in magazines etc. Let's say like school notes.

 

 

So, I thought to add these school notes attributes to some of my products in the catalogue settings of the BO.

If a product has now this given attribute (school note 1, 2 or 3 e.g.), then this should be seen in the product list.

I have images for these notes...

 

I hope, I could explain my idea and it would be too great if you could help me out here.

 

(PS: I had a look at the code for the 'new' item logo but could not manipulate it to my idea :)

Share this post


Link to post
Share on other sites

  • 2 months later...

Hi everybody,

 

I am trying to add the manufacturer in front of the product name and I succeeded with product.tpl but there is absolutely no way to get it to work in product-list.tpl

 

Working line in product.tpl

 

<h1>{$product->manufacturer_name|escape:'htmlall':'UTF-8'} {$product->name|escape:'htmlall':'UTF-8'}</h1>

 

I am adding a trace in front of the pruduct name and it shows (digit 1 f.instance) but when I pass exactly the same line as in product.tpl and that is

 

"{$product->manufacturer_name|escape:'htmlall':'UTF-8'}"

 

it doesn't work. The logo link that also works in product.tpl will also not work in product-list.tpl

 

Do I need to write anything in some other place? (maybe product.php...in /classes or smthg else?)

 

Thank you in advance for your help.

 

My Presta version is 1.4.10 by the way :)

product-list.txt

product.txt

Edited by msergiu80 (see edit history)

Share this post


Link to post
Share on other sites

  • 6 months later...
  • 3 weeks later...

This (see quote below) is working for me in Prestashop version 1.5.6. Thanks a lot!

 

How can I get the supplier name? Has anyone experience with this. 

 

Thanks for help!

 

This is a great customization!

I'm using PS 1.5.3.1 and I've managed to get the manufacturer's name to show only if a product has a manufacturer already assigned to it, here's the code if anyone wants to try it:
 

{if $product_manufacturer->name}{l s='Manufacturer'}: {$product->manufacturer_name|escape:'htmlall':'UTF-8'}{/if}
However I'd like to make the manufacturer_name part to be a clickable link to all products by that manufacturer as well. I can see that it would need to be similar to the code example given by mohsart a few posts up, but I have no idea what it would actually be (I'm not very good with stuff like this). Can anyone suggest something I could copy/paste and try out? Thanks in advance. :)

Elaine

 

Share this post


Link to post
Share on other sites

  • 3 weeks later...

This is a great customization!

 

I'm using PS 1.5.3.1 and I've managed to get the manufacturer's name to show only if a product has a manufacturer already assigned to it, here's the code if anyone wants to try it:

 

{if $product_manufacturer->name}{l s='Manufacturer'}: {$product->manufacturer_name|escape:'htmlall':'UTF-8'}{/if}
However I'd like to make the manufacturer_name part to be a clickable link to all products by that manufacturer as well. I can see that it would need to be similar to the code example given by mohsart a few posts up, but I have no idea what it would actually be (I'm not very good with stuff like this). Can anyone suggest something I could copy/paste and try out? Thanks in advance. :)

 

Elaine

 

Hi, I am not a programmer just learned every thing from presta forums members like you thanks for your ontribution...I am unable find find where to write this code means in which part of product.tpl , please help

Share this post


Link to post
Share on other sites

  • 1 month later...

thank you all for all the tips.
some worked others needed recoding for me.

so here is a little summary that is working on 1.5.6.2.
 

this is for showing and linking manufaturer in both product and product listing pages when a manufacturer is assigned

 

 

product.tpl :

{if $product_manufacturer->name}<h3><!--{l s='Manufacturer'}:--><a href="{$link->getmanufacturerLink($product->id_manufacturer, $product->link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List items made by'} {$product->manufacturer_name|escape:'htmlall':'UTF-8'}"> {$product->manufacturer_name|escape:'htmlall':'UTF-8'}</a></h3>{/if}

product-list.tpl :

{if $product.manufacturer_name}<h6><!--{l s='Manufacturer'}:--><a href="{$link->getmanufacturerLink($product.id_manufacturer, $product.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List items made by'} {$product.manufacturer_name|escape:'htmlall':'UTF-8'}"> {$product.manufacturer_name|escape:'htmlall':'UTF-8'}</a></h6>{/if}

you can uncomment the "<!--{l s='Manufacturer'}:-->" if you want a "Manufacturer:"(or its translation) displayed before the manufacturer name

 

 

 

cheers all!!!

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 5 weeks later...

Hey !

if you can have the manufacturer ID, you have the name : 
 

like in "shopping-cart-product-line.tpl" you can do : 

{assign var='manufacturer_name' value=Manufacturer::getNameById($product.id_manufacturer)}
{if isset($manufacturer_name)}{$manufacturer_name}{/if}
  • Thanks 1

Share this post


Link to post
Share on other sites

 

Hey !

if you can have the manufacturer ID, you have the name : 

 

like in "shopping-cart-product-line.tpl" you can do : 

{assign var='manufacturer_name' value=Manufacturer::getNameById($product.id_manufacturer)}
{if isset($manufacturer_name)}{$manufacturer_name}{/if}

Hi

 

I want to display the manufacture / brand on the product listing page, its coming on products details page but not in product listing. prestashop 1.6

 

http://bit.ly/1pzlXoW

 

Thanks

Share this post


Link to post
Share on other sites

 

Hey !

if you can have the manufacturer ID, you have the name : 

 

like in "shopping-cart-product-line.tpl" you can do : 

{assign var='manufacturer_name' value=Manufacturer::getNameById($product.id_manufacturer)}
{if isset($manufacturer_name)}{$manufacturer_name}{/if}

What If we need to show the images of Manufacturer?

Share this post


Link to post
Share on other sites

No one is actually helping me out on these forums I posted 2 problems but at the end after couple of days I had to figure out by my self. But I would like to help other who are struggling like me so here is the solution.

 

Those who are struggling - Add this to product-list.tpl

 

<img src="{$base_dir}img/su/{$product.id_supplier}.jpg" class="supplier_img" /> 

Edited by ashadweb (see edit history)

Share this post


Link to post
Share on other sites

sorry but you asked about manufacturer:

 

 

What If we need to show the images of Manufacturer?

and solution for this was already posted.

 

then you added post with image for supplier...

Share this post


Link to post
Share on other sites

  • 2 weeks later...

I wanted to show both if I can show manufacturer I can also show the supplier. But the point is until I put this no bothered helping me out even for manufacturer?  This wasn't my first problem  I posted another one too. Also you said solution was already posted? Where? I wanted to show the image not the name.

 

Anyway thanks for replying.

 

sorry but you asked about manufacturer:

and solution for this was already posted.

 

then you added post with image for supplier...

Edited by ashadweb (see edit history)

Share this post


Link to post
Share on other sites

ohh my God, so sorry for my confusion, to much coffe lol

<img src="{$img_manu_dir}{$product.id_manufacturer}-small.jpg" alt="{$product.manufacturer_name}" title="{$product.manufacturer_name}" />

change -small to image type defined in preferences > images tab (instead of "small" use imagetype name for manufacturer)

Share this post


Link to post
Share on other sites

  • 2 weeks later...

In home in 1.6 no work fine , but categories list, work perfect, the code into product-list.tpl , original no template

    <div class="centroanchoprod"> 
<a href="{$link->getPageLink('manufacturer.php')}?id_manufacturer={$product.id_manufacturer}" title="{$product.manufacturer_name}"><!--{$product.manufacturer_name}</a>-->
<img src="{$img_manu_dir}{$product.id_manufacturer}-medium_default.jpg" alt="{$product.manufacturer_name}" title="{$product.manufacturer_name}" /></a>
</div>
<!-------------

Only no work in the best sellers in home page.

post-319618-0-04975000-1400604409_thumb.jpg

Edited by Ron morales (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites

  • 3 weeks later...

I'm still seeking help as well.

 

I'm on PS1.6.

 

This is the issue so far: wheter i use

 

 

<a href="{$link->getPageLink('manufacturer.php')}?id_manufacturer={$product.id_manufacturer}" title="{$product.manufacturer_name}">{$product.manufacturer_name}</a>

 

or

 

 

 

{if $product.manufacturer_name}<h6><a href="{$link->getmanufacturerLink($product.id_manufacturer, $product.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='List items made by'} {$product.manufacturer_name|escape:'htmlall':'UTF-8'}"> {$product.manufacturer_name|escape:'htmlall':'UTF-8'}</a></h6>{/if}

 

i get the same results:

 

[Debug] This page has moved
Please use the following URL instead: http://friendly-seo-url-page

 

 

Any clues whats wrong?

 

Thanks!!

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Hi all.

I merged all solutions and successfuly add product manufacturer in homeheatured module (whould work with product-list.tpl too)

 

To show only product manufacturer name in homefeatured

{$product.manufacturer_name}

To show product manufacturer logo in homefeatured

 <img src="{$content_dir}img/m/{$product.id_manufacturer}-medium_default.jpg" alt="{$product.manufacturer_name}" />

Cheers!

 

post-583420-0-84045700-1405090322_thumb.jpg

Edited by kisweb (see edit history)

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Work for me with :

{if $product->id_manufacturer>0}<img src="{$content_dir}img/m/{$product->id_manufacturer}-medium_default.jpg" alt="{$product->manufacturer_name|escape:'htmlall':'UTF-8'}" />{/if}

 

Thanks for the hack !

Share this post


Link to post
Share on other sites

  • 2 months later...

Work for me with :

{if $product->id_manufacturer>0}<img src="{$content_dir}img/m/{$product->id_manufacturer}-medium_default.jpg" alt="{$product->manufacturer_name|escape:'htmlall':'UTF-8'}" />{/if}

 

Thanks for the hack !

 

Nicely done. Your piece of code works in product page. To make it work in product-list or homefeatured modules simply use

"." (dot) instead of "->"

 

Like below :

{if $product.id_manufacturer>0}<img src="{$content_dir}img/m/{$product->id_manufacturer}-medium_default.jpg" alt="{$product->manufacturer_name|escape:'htmlall':'UTF-8'}" />{/if}
  • Like 1

Share this post


Link to post
Share on other sites

  • 1 month later...

Hello,

 

Thanks for your help guys, displaying the manufacturer on the product listing works well for me.

But now I need to display it everywhere I have products: New products (left column), cart, etc...

 

Can anybody help? I can't find where to place the code for the new products and what code to place.

 

Thank you :)

Share this post


Link to post
Share on other sites

Hello,

 

Thanks for your help guys, displaying the manufacturer on the product listing works well for me.

But now I need to display it everywhere I have products: New products (left column), cart, etc...

 

Can anybody help? I can't find where to place the code for the new products and what code to place.

 

Thank you :)

 

in this case you will have to modify each module that you have that displays products.

for example, new products in left column is blocknewproducts module

you have to do the same for each other module you have.

Share this post


Link to post
Share on other sites

in this case you will have to modify each module that you have that displays products.

for example, new products in left column is blocknewproducts module

you have to do the same for each other module you have.

 

Hi Vekia,

 

Thanks for your answer but you doubt I tried this before asking here ;)

I have been playing with the css and tpl files of PS for weeks now so I know where to find the modules and files involved. But the problem is I am trying to paste a code I found on this forum (for displaying manufacturers name in the product page) but it's doesn't want to display...

 

This is the code I modified in the product.tpl file :

<h1 itempromp="name"><p id="manufacturer_name" {if !$product->manufacturer_name}style="display: none;"{/if}><span class="editable">{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</span></p>
			<div class="product-name">{$product->name|escape:'html':'UTF-8'}</div></h1>

And here the other code I tried too: (the one that I have in the product-item.tpl file:

<h4 class="manufacturer-name-list">{$product.manufacturer_name|escape:'htmlall':'UTF-8'}</h4>

I tried to paste both of these codes in the blocknewproducts.tpl file but it still doesn't display.

 

My question is, what is the right code to paste then? Neither of the previous codes work for the "new products".

 

Thanks

Share this post


Link to post
Share on other sites

  • 10 months later...

In home in 1.6 no work fine , but categories list, work perfect, the code into product-list.tpl , original no template

    <div class="centroanchoprod"> 
<a href="{$link->getPageLink('manufacturer.php')}?id_manufacturer={$product.id_manufacturer}" title="{$product.manufacturer_name}"><!--{$product.manufacturer_name}</a>-->
<img src="{$img_manu_dir}{$product.id_manufacturer}-medium_default.jpg" alt="{$product.manufacturer_name}" title="{$product.manufacturer_name}" /></a>
</div>
<!-------------

Hi. I have the same problem in 1.6. Please did you find a solution

Only no work in the best sellers in home page.

Edited by ajaxthemestudios (see edit history)

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More