[Typo3-shop] Problem extending tt_products

Vikram Mandal [Typo3India] vikram at typo3india.com
Fri Jan 27 09:47:56 CET 2006


Simon Tuck wrote:

>>update to the latest versions of these extensions.
>>
>>Try to do the same with tt_address and check if this works with the
>>tt_address table.
>>    
>>
>
>Hi Franz,
>Ok, I've updated all of the above and also added a field to tt_address.
>my extension now does:
>t3lib_div::loadTCA('tt_products');
>t3lib_div::loadTCA('tt_address');
>tx_table_db::setTCAFieldArray('tt_products');
>tx_table_db::setTCAFieldArray('tt_address');
>$content= t3lib_div::view_array(array(
>	'TCA-products' => $GLOBALS['TCA']['tt_products'],
>	'TCA-fe_users' => $GLOBALS['TCA']['fe_users'],
>	'TCA-tt_address' => $GLOBALS['TCA']['tt_address'],
>));
>In the frontend now for tt_products my additional field is not present, for tt_address it is present in 
>$GLOBALS['TCA']['tt_address']['feInterface'] but not in $GLOBALS['TCA']['tt_address']['columns'].
>On the other hand if I add the line tslib_fe::includeTCA(); my additional fields are fully included for tt_products and 
>tt_address.
>Hope that helps...
>Cheers
>Simon
>
Hi,

I had the same problem .. the follow code helped me.

/* mergeExtendingTCAs($ext_keys)
*
*  In case you wrote an extension, that extends the table "$table", then
*  the TCA information for the additional fields will be merged with the 
"$table" TCA.
*
*  @param array Extension TCA's that should be merged.
*/
function mergeExtendingTCAs($ext_keys){

	global $_EXTKEY, $TCA;
		//Merge all ext_keys
	if (is_array($ext_keys)) {
		for($i = 0; $i < sizeof($ext_keys); $i++){
			//Include the ext_table
			$_EXTKEY = $ext_keys[$i]; // added by F.Rakow
			include(t3lib_extMgm::extPath($ext_keys[$i]).'ext_tables.php');
		}
	}
}

--

Regards,
Vikram Mandal
----------------------------------------------------------------
http://www.typo3india.com - connect.innovate.share





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