Jump to content

Add manufacturer description into product page


Xinito87

Recommended Posts

Hi!

 

I want to show the MANUFACTURAR DESCRIPTION nest to the product description and DATA SHEET tabs in the product page.

 

I'm trying to do it but I don't find the way to solve it.

 

Anyone has done it or has an idea about the line of code that I have to introduce?

 

I'm thinking about modify product.tpl , but I'm not sure.

 

If you can help me, my version is 1.5.6

 

Thanks.

Link to comment
Share on other sites

You should get product manufacturer in product controller assign it and view it the tpl.

$id_lang = $this->context->language->id;
$manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang);
$manuf_description = $manufacturer->description[$id_lang];
$this->context->smarty->assign('manufact_desc', $manuf_description);

And in the tpl  should call your manufacturer description as {$manufact_desc}

Edited by tarek.fellah (see edit history)
  • Like 1
Link to comment
Share on other sites

Yes, I want to show this Manufacturers description as a TAB.

 

I tryed to Copy and Paste the code in ProductController.php and call the function in Product.TPL but it doesn't work for me.

 

I don't know if I'm missing something, if it's not annoying, if someone can exdplain step by step what I have todo, I think it's not complicated a lot but I'm mnore designer no than programmer and I need to solve it.

 

Thanks a lot!!

Link to comment
Share on other sites

Hi Tarek,

 

Now appear this line in my website : $id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description[$id_lang]; $this->context->smarty->assign('manufact_desc', $manuf_description);

 

http://topminerales.com/en/jewelry-/20-collar-de-hematite-cuerda.html

 

I don't know how to make it disappear.... :s

 

Please help, thanks.

Link to comment
Share on other sites

Hi,

You should add the php code in iniContent function in ProductController.php, i use Prestashop 1.5.4, in my case i can insert the code in line 207 before this code:

$this->context->smarty->assign(array(
				'pictures' => $pictures,
				'textFields' => $text_fields));

try to change and let me know the result.

Edited by tarek.fellah (see edit history)
Link to comment
Share on other sites

Hi Tarek,

 

It doesn't work for me, if you can check this link you will se that now appear this text : $id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description[$id_lang]; $this->context->smarty->assign('manufact_desc', $manuf_description);

 

http://topminerales.com/en/jewelry-/20-collar-de-hematite-cuerda.html

 

If you can specify which files I have to modify and where I have to introduce the codes that you are sending to me, because I can't find the way to make it work now... I'm beginner programmer.

 

Thanks.

Link to comment
Share on other sites

Hi,

You should add the php code in iniContent function in ProductController.php, i use Prestashop 1.5.4, in my case i can insert the code in line 207 before this code:

$this->context->smarty->assign(array(
				'pictures' => $pictures,
				'textFields' => $text_fields));

try to change and let me know the result.

You don't read this post?, you shoud put the code

$id_lang = $this->context->language->id;
$manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang);
$manuf_description = $manufacturer->description[$id_lang];
$this->context->smarty->assign('manufact_desc', $manuf_description);

in /controllers/ProductController.php at line 207

Link to comment
Share on other sites

I tryed tu put the code where you told me, and it's not working.

 

Now I have removed the code... because it was not working, and keep appearing this on my site :s

 

$id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description[$id_lang]; $this->context->smarty->assign('manufact_desc', $manuf_description);

Link to comment
Share on other sites

I tryed tu put the code where you told me, and it's not working.

 

Now I have removed the code... because it was not working, and keep appearing this on my site :s

 

$id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description[$id_lang]; $this->context->smarty->assign('manufact_desc', $manuf_description);

try with this code, i tested it and it works

$id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description;  $this->context->smarty->assign('manufact_desc', $manuf_description);

Don't forget to put {$manufact_desc} in your Product.tpl file

Link to comment
Share on other sites

I think now is OK!

 

I introduced ( {$manufact_desc} ) like this :

 

       <h6> {l s='Manufacturer'} </h6>
<div id="idTab22" class="rte">{$manufact_desc}</div>
{/if}
 
So I have the title and it implemented in the TAB.
 
Thanks!
Link to comment
Share on other sites

  • 1 month later...

try with this code, i tested it and it works

$id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description;  $this->context->smarty->assign('manufact_desc', $manuf_description);

Don't forget to put {$manufact_desc} in your Product.tpl file

Hi I am not able to display  MANUFACTURAR tab on product detail page its displaying fine on prestashop 1.4.9 which is http://biophoretics.com/biochemicals-a-z/119-acarbose-cas-56180-94-0-serva.html

 

nut in prestashop 1.5.4 I am unable to display it

 

I tried to copy and paste the above code you mentioned

there are 2 files in root directory

 

/public_html/controllers/front/ProductController.php
application-x-httpd-php.png
/public_html/newbiosite/controllers/front/ProductController.php

 

 

 

Which file should i edit ?

 
 
 
Link to comment
Share on other sites

let's clarify what you already did :)

you attached manufacturers_desc to the smarty array in controller?

This is new version 1.5.4

 

http://goelectrophoresis.com/newbiosite/blotting-instruments/174-tv100-ebk-mini-electroblotter.html

 

and old version has tab below please check

 

http://biophoretics.com/blotting-instruments/174-tv100-ebk-mini-electroblotter.html

 

 

I want same Manufacturer tab to be displayed as it is displaying on the bottom section with downloads and other tabs

 

I hope I clarify now

Link to comment
Share on other sites

try with this code, i tested it and it works

$id_lang = $this->context->language->id; $manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang); $manuf_description = $manufacturer->description;  $this->context->smarty->assign('manufact_desc', $manuf_description);

Don't forget to put {$manufact_desc} in your Product.tpl file

Where should I put {$manufact_desc} in my product.tpl file ?

Link to comment
Share on other sites

 

I think now is OK!

 

I introduced ( {$manufact_desc} ) like this :

 

       <h6> {l s='Manufacturer'} </h6>
<div id="idTab22" class="rte">{$manufact_desc}</div>
{/if}
 
So I have the title and it implemented in the TAB.
 
Thanks!

 

Can you show me original product.tpl code which worked for you?

Link to comment
Share on other sites

ok so go to productCOntroller.php (controllers/front/productController.php) and in init function add this code:

$id_lang = $this->context->language->id;
$manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang);
$manuf_description = $manufacturer->description[$id_lang];
$this->context->smarty->assign('manufact_desc', $manuf_description);

then in product.tpl (located in your theme directory) you will be able to use {$manufact_desc} variable to display manufacturer description

Link to comment
Share on other sites

ok so go to productCOntroller.php (controllers/front/productController.php) and in init function add this code:

$id_lang = $this->context->language->id;
$manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang);
$manuf_description = $manufacturer->description[$id_lang];
$this->context->smarty->assign('manufact_desc', $manuf_description);

then in product.tpl (located in your theme directory) you will be able to use {$manufact_desc} variable to display manufacturer description

Done great help now one questions is it possible to import 1.4.9 product database to  1.5.4?

Link to comment
Share on other sites

ok so go to productCOntroller.php (controllers/front/productController.php) and in init function add this code:

$id_lang = $this->context->language->id;
$manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang);
$manuf_description = $manufacturer->description[$id_lang];
$this->context->smarty->assign('manufact_desc', $manuf_description);

then in product.tpl (located in your theme directory) you will be able to use {$manufact_desc} variable to display manufacturer description

But this is not displaying the option to select manufacturer on product edit page on admin just like I have on 1.4.9 can we display manufacturer drop down on admin as well?

Link to comment
Share on other sites

ok so go to productCOntroller.php (controllers/front/productController.php) and in init function add this code:

$id_lang = $this->context->language->id;
$manufacturer = new Manufacturer($this->product->id_manufacturer, $id_lang);
$manuf_description = $manufacturer->description[$id_lang];
$this->context->smarty->assign('manufact_desc', $manuf_description);

then in product.tpl (located in your theme directory) you will be able to use {$manufact_desc} variable to display manufacturer description

Hi could you please explain how can I use {$manufact_desc} variable in product.tpl file

Link to comment
Share on other sites

  • 10 months later...

I know this is an old thread, But I've just tried this myself and it works, except it doesn't seem to get past the first character of the description!

For example, the manufacturer description html is something like this:

 

<p>Etnies have been making quality footwear since ...</p>

 

All that appears on the page is "p" !

I wondered if it was someting to do with the html code in the description, so changed the P tag to an H1 tag, and sure enough... all I get is an "H"!!

 

Any ideas why?

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