[Typo3-shop] Problem extending tt_products
Simon Tuck
e-mailNO at SPAMeyejet.com
Thu Jan 26 13:46:55 CET 2006
Simon Tuck wrote:
> Hi Franz,
> Thanks for getting back to me so quickly.
>> There must be somewhere an error here, because if your extensions really
>> adds fields to the TCA then these must be there.
> yes, I agree. it's very strange.
>> Try to debug the $TCA['tt_products'] to check if the added fields are
>> there.
>> tx_table_db::setTCAFieldArray after t3lib_div::loadTCA($table);
> did that. I made a small ext with the kickstarter and added 1 field to
> tt_products and 1 field to fe_users, then I output the following:
> t3lib_div::loadTCA($table);
> tx_table_db::setTCAFieldArray;
> $content= t3lib_div::view_array(array(
> 'TCA-products' => $GLOBALS['TCA']['tt_products'],
> 'TCA-fe_users' => $GLOBALS['TCA']['fe_users'],
> ));
> The TCA-fe_users contains my additional field, but TCA-products is still
> the original tt_products TCA (The result is the same with or without the
> first 2 lines).
> This is on a clean T3 installation and the only installed extensions are
> rte, table(0.0.6), fh_library(0.0.5), tt_products (2.3.10), kickstarter
> & test_extend_shop (above 'small ext').
> Also, if I check the configuration in the BE (Tools > configuration >
> TCA (tables.php)) my additional field is in the TCA (as expected).
> Meantime I've hardcoded the additional fields into the tt_products TCA -
> that works. Still, it's a very strange issue. Is there anywhere else I
> could debug to try and find out what's going on here?
> Cheers,
> Simon
>
>
I think I have found the problem. By default the entire TCA is not loaded in the frontend:
"Normally in the frontend only a part of the global $TCA array is loaded, for instance the "ctrl" part. Thus it doesn't take
up too much memory."
see: http://typo3.org/fileadmin/typo3api-3.8.0/d2/df2/classtslib__fe.html
So I've added the line
tslib_fe::includeTCA();
to main in class.tx_ttproducts_pi1.php
Now my additional fields are included in the front end!
Cheers,
Simon
PS. on line 145 of class.tx_ttproducts_pricecalc_div.php there is a typo:
foreach ($countedItems[$pricefor1Index] as $ $k4 => $v4) {
should be:
foreach ($countedItems[$pricefor1Index] as $k4 => $v4) {
More information about the TYPO3-project-tt-products
mailing list