Jump to content

Add manufacturer description into product page


Xinito87
 Share

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.

Share this post


Link to post
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

Share this post


Link to post
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!!

Share this post


Link to post
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.

Share this post


Link to post
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)

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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);

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
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 ?

 
 
 

Share this post


Link to post
Share on other sites

it's a part of your theme directory

path, for default theme, looks like:

 

themes/default/product.tpl

And could you please tell me the code which I should put in product.tpl to make sire manufacturer tab display on product detail page

Share this post


Link to post
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

Share this post


Link to post
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 ?

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

still no answer to my question

I do not understood what you are talking about could you please copy code here or on your website which needs to be copy and pasted on specific file

I am not tech person please explain above a little

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

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