[TYPO3-commerce] category name in products product list items?

Franz Koch typo.removeformessage at fx-graefix.de
Thu Sep 27 10:16:00 CEST 2007


Hi Cray,

> I need to show category name in product list items. Can anybody show me 
>  the way to make it. I can't find any marker for it. Do I need to make 
> some custom things? Help me please...

yes, I think you have to create your own marker for that. But that is no 
problem, due to the numerous hooks for commerce.

Using hooks is easy. Have a look inside the docs folder of commerce to 
see a list of all available hooks. In your case (for adding a new 
product marker), do something like:

a) create your own extension, or use the ext_tables*.php in your 
localConf folder

b) register the hook like this:
--------
require_once('path_to_your_class/class.name_of_class.php')
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_pibase.php']['product'][] 
= 'name_of_class';
--------

c) create the class file:
--------
class name_of_class {
   function additionalMarkerProduct($markerArray,&$product,&$parent) {
     // here your code to fetch the categories name
     // ...

     $markerArray['###YOUR_CUSTOM_MARKER###'] = $varWithCategoryName;
     return $markerArray;
   }
}
---------

That's it.

--
Kind regards,
Franz Koch


More information about the TYPO3-project-commerce mailing list