Jump to content

How to display manufacturer info on product page


orwell

Recommended Posts

Hi everyone,

 

I'm quite a noob with prestashop and I'd like to do something that seemed quite simple but isn't.

 

I want to be able to display various info about the manufacturer on a product page.

I get the manufacturers name and id from $product in my product.tpl.

 

How could I get the manufacturer info to display it on my product.tpl ?

I'm not sur on how to tackle that... extend the product class, write a module... ?

 

Any help would be great as it would help me to understand prestashop a little bit more !

 

Thanks

Link to comment
Share on other sites

Ok so I managed to get a $manufacturer object via a custom module I've built.

 

Still wondering, isn't there a easier way to add data passed to a smarty template ? Extending the product class ?

 

Thanks for helping me getting better with PrestaShop !

Link to comment
Share on other sites

Hi,

 

you can access the manufacturer in the product.tpl template with {$product_manufacturer}.

 

Here a list of important manufacturer attributes:

ID: {$product_manufacturer->id}

Name: {$product_manufacturer->name}

Description: {$product_manufacturer->description}

Short Description: {$product_manufacturer->short_description}

 

Regards, genix.

  • Like 1
Link to comment
Share on other sites

 

ID: {$product_manufacturer->id}

Name: {$product_manufacturer->name}

Description: {$product_manufacturer->description}

Short Description: {$product_manufacturer->short_description}

 

 

Seems that none of those work in my product.tpl ...

 

Anyway now i need to fetch the manufacturer's product, so I'll keep on with the solution I've got which is building a custom module to display what I need.

Link to comment
Share on other sites

Hmm... the controller seems fine.

 

And even if you are in development mode (I just tried), you'll have to enforce recompilation...

I think the problem is, that your product.tpl template is cached.

 

Try to also deactivate all cache systems.

Edited by genix (see edit history)
Link to comment
Share on other sites

  • 2 months later...

super easy

 

just substistute de XXX

 

 

<!-- product page manufacturer -->

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

<label for="manufacturer">{l s='XXXXX'} </label>

<a href="{$link->getmanufacturerLink($product->id_manufacturer, $product->link_rewrite)}" title="{l s=''}">

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

</a>

</p>

<!-- product page manufacturer end -->

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Hi,

 

you can access the manufacturer in the product.tpl template with {$product_manufacturer}.

 

Here a list of important manufacturer attributes:

ID: {$product_manufacturer->id}

Name: {$product_manufacturer->name}

Description: {$product_manufacturer->description}

Short Description: {$product_manufacturer->short_description}

 

Regards, genix.

 

is this applicable for ver 1.4?? doesn't seem to work @ all, even with all cahce functions turned off and forced recompile set....

Link to comment
Share on other sites

  • 3 weeks later...

I would like to

super easy

 

just substistute de XXX

 

 

<!-- product page manufacturer -->

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

<label for="manufacturer">{l s='XXXXX'} </label>

<a href="{$link->getmanufacturerLink($product->id_manufacturer, $product->link_rewrite)}" title="{l s=''}">

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

</a>

</p>

<!-- product page manufacturer end -->

 

I would like to display the manufacturers logo next to each product in a list, as well as on the products page

Would you please inform me how this can be done?

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