Sie befinden sich hier: Services / Web / TYPO3 / tt_products - Additional Fields
English
Deutsch
¬Social Bookmarks 
digg.comFurlgoogle.comstumbleupon.com

The TYPO3 shop extension tt_products is one of the classic extensions available for years. Initiallly it has been developed by the Typo3 initiator Kasper Skårhøj with the help of René Fritz. The development has been continued by several persons.

Although it is a very helpful tool, sometimes things are missing, of course.

This short article shows how to add fields to forms like the customer details form. It relates to the tt_products release 2.6.0.

Supposed you want to add a second line for the company name. Edit your shop template file products_template.html, look for the submarker ##BILLING_ADDRESS###

Below

<tr>
<td>###GW1B###<strong>Company</strong>###GW1E###</td>
<td><input type="text" name="recs[personinfo][company]" size="30" value="###PERSON_COMPANY###"><font color="red">*</font></td>
</tr>

You add

<tr>
<td>###GW1B###<strong>More Company</strong>###GW1E###</td>
<td><input type="text" name="recs[personinfo][company2]" size="30" value="###PERSON_COMPANY2###"></td>
</tr>

Now the form shows the additional row, unfortunatelly ###PERSON_COMPANY2### is shown literally:

This happens since tt_products is not aware of the new field. To make the additional field known to you have to patch the code. Open lib/class.tx_ttproducts_info.php and add 'company2' to the locations where you find first_name. E.g. To

function getItemMarkerArray (&$markerArray, $bSelectSalutation) {
global $TCA, $TSFE;
global $TYPO3_CONF_VARS;
// Personal and delivery info:
$list = 'name,first_name,last_name,username,title,address,telephone,fax,email,company,city,zip,state,country,tt_products_vat';
// PATCH
$list .= ',company2';

Do this for all occurences of first_name, which should be the case three times.

Additional fields are added the same way.

Wenn Sie diesen beiden Bücher haben und nutzen, kann Ihnen kaum etwas passieren:

TYPO3 Kochbuch
Eine Buch voller wertvoller Details; keines, dass Ihnen Schritt für Schritt den Weg zeigt.

 

TYPO3 und TypoScript - Kochbuch. Lösungen für die TYPO3-Programmierung mit TypoScript und PHP  

Im Mai 09 erschien diese neue Auflage des Klassikers.

 

Beide Bücher sind nicht für die ersten Schritte mit TYPO3 empfehlen, sie richten sich eher an Personen, die schon etwas Erfahrungen mit dem Framework haben.

 
www.telos.de