[TYPO3-shop] extended ListView

Tomasz Rakowski raczek at open.infi.pl
Wed Jul 26 23:58:29 CEST 2006


Seytzhan A. napisał(a):
> Hi, Tomasz!
> Could u explain me shortly, how did u extend your tt_products table?
> And how to set own markers in template?
> I can't find anything about this in manual...
> 
> I am using tt_products 2.5.0, typo3 3.8.1
> 
> Thanx in advance!
> Seytzhan.
> 
> Tomasz Rakowski wrote:
>> Tomasz Rakowski napisał(a):
>>> Hello!
>>>
>>> I am using tt_products 2.4.8, typo3 3.8.1
>>> I have extended my tt_products table. Everything is ok in the 
>>> backend, new fields are displayed, data is written to database. All 
>>> works fine there.
>>> I wanted to dispaly some new fields in the listview mode and it 
>>> turned out that it does not work. My markers are substituted with 
>>> nothing in listview, but work fine in single view.
>>> Debugging showed me that for listview only some specific fields are 
>>> taken:
>>> [0] => uid [1] => pid [2] => category [3] => price [4] => price2 [5] 
>>> => title [6] => image [7] => subtitle
>>>
>>> How to change this? Is there something like listview parameter in 
>>> tt_products configuration? I want it to read all my fields in 
>>> listview, tell me if it's possible?
>>>
>>> thx in advance!!
>>> racco
>> ok, I figured that out;
>>
>> markers must start with PRODUCT_ to get them listed on listView
>>
>>
>>
>> cu
>> racco


[1.] Create an extensions which adds your additional fields to the 
relevant tt_products tables using the kickstarter.

[2.] Add the following hook to your extensions ext_localconf.php file:
$TYPO3_CONF_VARS['EXTCONF'][TT_PRODUCTS_EXTkey]['extendingTCA'][] = 
$_EXTKEY;

[3.] Use the hook 'getItemMarkerArray' in tt_products to render your 
additional fields:
[3a.] Create your custom script to render these additional fields, e.g. 
path/to/my/script/filename.php
The function you can hook looks like this:
function getItemMarkerArray ($pObj, &$markerArray, $item, $catTitle, 
$tt_products, $tt_content, $imageNum, $imageRenderObj, $forminfoArray)
[3b.] Add your script to the tt_products hook in your extensions 
ext_localconf.php file:
$TYPO3_CONF_VARS['EXTCONF'][TT_PRODUCTS_EXTkey]['getItemMarkerArray'][] 
= 'path/to/my/script/filename.php:&my_custom_class';


Example hook_file:

class tx_shopnewfile_hook {


  function getItemMarkerArray ($pObj, &$markerArray, $item, $catTitle, 
$tt_products, $tt_content, $imageNum, $imageRenderObj, $forminfoArray)
  {

$row = &$item['rec'];


$markerArray['###INSTRUKCJA###'] ='<a 
href="uploads/tx_ttproducts/instrukcje/'.$row['tx_shopnewfield_plik'].'">'.'Pobierz 
plik'.'</a>' ;

}



greetings
racco



More information about the TYPO3-project-tt-products mailing list