Jump to content

[MODULE] Display the categories to which a product belongs


Recommended Posts

Simple module created to display the categories under which a product is filed.

The module hooks to the Product Footer hook.

You can style the list via a css file.

 

Currently translated in FR and EN.

Only tested on PS 1.4.x don't know about earlier versions.

productcategories-v0.9.zip

Edited by orwell (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Simple module created to display the categories under which a product is filed.

The module hooks to the Product Footer hook.

You can style the list via a css file.

 

Currently translated in FR and EN.

Only tested on PS 1.4.x don't know about earlier versions.

 

 

Thank you.

 

are there any Print Screen, please?

Share this post


Link to post
Share on other sites

are there any Print Screen, please?

 

Here is a screenshot of a product page. It's in french but the module outputs the last paragraph.

 

The output is pretty basic, so you shouldn't have any trouble styling the template to your needs.

post-373392-0-31041300-1345138573_thumb.png

  • Like 1

Share this post


Link to post
Share on other sites

Thank you !!

 

Works well for me with Prestashop 1.5RC2

 

 

-----

 

For my necessities I add the link -> manufacturer.

 

In the php :


public function hookProductFooter($params)
{
global $smarty, $cookie, $products;
$id_lang = $cookie->id_lang;
$idProduct = (int)(Tools::getValue('id_product'));

$categories_ids = Product::getProductCategories($idProduct, $id_lang);
$product_infos = new Product($idProduct, true, intval($cookie->id_lang)); // Product Informations

foreach ($categories_ids AS $id) {
  $category = new Category($id, $id_lang);
  $categories[$id]['name'] = $category->name;
  $categories[$id]['link'] = $category->getLink();

} 

$smarty->assign(array(
'productCategories' => $categories,
'product_infos' => $product_infos  // Product Informations
));

return $this->display(__FILE__, 'productcategories.tpl'); 

}

 

 

and in the .tpl before the foreach :

 


<li><a href="{$link->getmanufacturerLink($product_infos->id_manufacturer, $product_infos->link_rewrite)}" title="{$product_infos->manufacturer_name|escape:'htmlall':'UTF-8'}" >{$product_infos->manufacturer_name|escape:'htmlall':'UTF-8'}</li>

 

With $product_infos it would be easy to add the supplier...

 

 

Thanks again :)

Edited by Médéric (see edit history)

Share this post


Link to post
Share on other sites
  • 2 months later...

Simple module created to display the categories under which a product is filed.

The module hooks to the Product Footer hook.

You can style the list via a css file.

 

Currently translated in FR and EN.

Only tested on PS 1.4.x don't know about earlier versions.

 

 

I would like to have this fonction, Thank you !! But the module don't works with Prestashop 1.5.0.17. I can't see it in the module list. It's because I am a neophyte ?

Share this post


Link to post
Share on other sites
  • 4 weeks later...
  • 2 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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