Jump to content

How to display manufacturer/brand of a product on each kind of page


Matsera

Recommended Posts

Hi,

I try to find a way to display the brand/manufacturer of a product on each pages where there is a product description.

 

I've found a way to do this by changing a line on "product.tpl" but it only works on the product description page.

I would like this every time the product appear (home page, category page, etc ...).

 

My theme is "Transformer" and my Prestashop version is 1.5.6.1

 

 

For example it would appear like this :

 

Apple

Ipode nano

...

 

Thanks for your help.

Link to comment
Share on other sites

For product-list.tpl:

Add this somewhere inside the product box (just before name or so)

{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name}</span>{/if}

 

 

for homefeatured.tpl

add the red code to the existing product.name code (Code example from 1.5.5.0, may differ slightly in other versions):

<p class="s_title_block">{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name|escape:'htmlall':'UTF-8'}</span>{/if}<a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>
 

 

 

 

css as desired.  Add to themes/<your theme folder>/css/global.css:

  .product_manufacturer_name { add your own css code here }

 

 

Hope this helps,

pascal

  • Like 3
Link to comment
Share on other sites

Hi Pascal,

Thanks for your help. It works.

 

My problem seems to be very easy but if I understand I have to modify all tpl files where there is a product name ...

 

In the category page, on the left column, products appear in column with an arrow to display all category products.

Beside, I can also see "viewed products" in column.

 

Can you tell me please what are those tpl names ?

 

 

Can you confirm me too that I have to modify all places where products are shown on my pages ?

There is no other way to do using classes or I don't know what ?

 

 

Thank you again for your precious help.

Link to comment
Share on other sites

Hi Matsera,

From memory: left categories block is

themes/<your theme folder name>/modules/blockcategories/blockcategories.tpl

 

Viewed products: can't fully remember the name. Thought something like:

themes/<your theme folder name>/modules/blockviewed/blockviewed.tpl

 

As you really add some functionality, I'm afraid you indeed need to add this to the tpl files where needed...

 

Do you really ALWAYS want to change the product name to: manufacturer name+ product name? Then you could override the name attribute of the product. But then you're stuck with it everywhere :-)

 

Let me know if this is desired,

Pascal

Link to comment
Share on other sites

  • 2 months later...

Hello Pascal,

 

Thank you for your answer that serves me also, but I'm in the case you described in your last post. I want to ALWAYS change the product name to: manufacturer name+ product name. You are talking about overriding the attribute of the product, how does this work ? I'm a bit new to Prestashop : )

 

Thak you in advance,

Clément

Link to comment
Share on other sites

  • 11 months later...

Hello, I am new in prestashop, and i want to do this:

 

when the client enter in my site and choose any category that appears all brand logos and when he click on any logo that appear all products of this brand.

 

Anybody can help me?

Link to comment
Share on other sites

  • 1 month later...

Thank you pascal, I was able to make manufacture display in home page and category page using the instruction.

However in product detail page It I want the manufacturer to show above product name.

Also, in left column and right column, Viewed products, new products, top sellers, and products in same category at the product page footer to display manufacturer name.

How could I achieve it. Could you please help.

 

Below link is the site fyi.

http://www.kocamoca.com/en/exfoliate/16-phytowash-yerba-mate-bubble-peeling.html

.

Thank you in advance for your help

Link to comment
Share on other sites

For product-list.tpl:

Add this somewhere inside the product box (just before name or so)

{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name}</span>{/if}

 

 

for homefeatured.tpl

add the red code to the existing product.name code (Code example from 1.5.5.0, may differ slightly in other versions):

<p class="s_title_block">{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name|escape:'htmlall':'UTF-8'}</span>{/if}<a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>
 

 

 

 

css as desired.  Add to themes/<your theme folder>/css/global.css:

  .product_manufacturer_name { add your own css code here }

 

 

Hope this helps,

pascal

I'm trying to get this to display manufacturers and nothing happens. I have tried pasting it in multiple different locations inside products-list.tpl. I am using 1.6.. any update on this? With this code there is no error message, just nothing shown. I would like so when hitting a category the brands are shown, any brand in that category. I'm surprised this is not common and standard. I've seen it on other shopping cart software. I've also tried these methods, but they appear outdated code at this point of v1.6...

https://www.prestashop.com/forums/topic/45835-solved-list-manufacturers-under-category-page/

and

https://www.prestashop.com/forums/topic/141669-display-manufacturers-on-category-page-specific-to-category/

and

https://www.prestashop.com/forums/topic/277309-how-to-group-products-by-manufacturer-in-product-list-category-or-sub-category-pages/ 

which the last one I thought was a great direction, but it gave errors. . 

I'm using default bootstrap, brand new prestashop install, 1.6 only 2 3rd party modules installed and currently disabled. . 

Link to comment
Share on other sites

  • 2 weeks later...

To display manufacture in home page, category page

In product-list.tpl line 113 right after add red code.

Like below

                                                                <h5 itemprop="name">

                                                                                {if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name}</span>{/if}

                        {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}

 

For homefeatured.tpl

add the red code to the existing product.name code

<p class="s_title_block">{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name|escape:'htmlall':'UTF-8'}</span>{/if}<a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>

 

To display manufacturer in product detail page

in product.tpl

<h1 itemprop="name">{$product->name|escape:'html':'UTF-8'}</h1>

                                    <p id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>

                                                <label>{l s='Reference:'} </label>

                                                <span class="editable" itemprop="sku">{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>

                                    </p>

            <p id="manufacturer" {if !$product_manufacturer->name}style="display: none;"{/if}>

                                                <label>{l s=''} </label>

                                                <a href="{$link->getManufacturerLink($product_manufacturer->id_manufacturer, $product_manufacturer->link_rewrite)|escape:'html':'UTF-8'}"><span>{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</span></a>

                                    </p>

 

then final step

in global.css add below code at the end

 

.product_manufacturer_name {
    color: #f63195;
    font-weight: bold;
    background-color: transparent; }

 

It took me quite a long time to find right places to put those codes in.

Hope it helps.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

Fatal error: Cannot use object of type Product as array in /hermes/bosnaweb25a/b1627/ipg.hstpctech13804/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 309

On 2/11/2014 at 1:48 PM, PascalVG said:

For product-list.tpl:

Add this somewhere inside the product box (just before name or so)

{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name}</span>{/if}

 

 

for homefeatured.tpl

add the red code to the existing product.name code (Code example from 1.5.5.0, may differ slightly in other versions):

<p class="s_title_block">{if isset($product.manufacturer_name)}<span class="product_manufacturer_name">{$product.manufacturer_name|escape:'htmlall':'UTF-8'}</span>{/if}<a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>
 

 

 

 

css as desired.  Add to themes/<your theme folder>/css/global.css:

  .product_manufacturer_name { add your own css code here }

 

 

Hope this helps,

pascal

 

The modification looks plain and simple but unfortunately, it doesn't work for me yet. It gave error message:

Fatal error: Cannot use object of type Product as array in /hermes/bosnaweb25a/b1627/ipg.hstpctech13804/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 309

Link to comment
Share on other sites

  • 11 months later...
On 4/11/2015 at 2:08 PM, orlovskyy said:

Hello, I am new in prestashop, and i want to do this:

 

when the client enter in my site and choose any category that appears all brand logos and when he click on any logo that appear all products of this brand.

 

Anybody can help me?

Did you ever found a solution for this?

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