Zum Inhalt springen

sr_feuser_registration und tt_products: Anrede übernehmen

Erstellt am 4. Dezember 2007 · 1 Antwort · letzte Antwort am 29. Januar 2008

Tags: Frontend-Benutzer, Frage

kwottkam ·

Hallo,

bei mir wird die Anrede aus sr_feuser_registration (Feld gender) nicht in das Bestellformular von tt_products (PERSON_SALUTATION).

Gibt's da einen Trick oder mache ich was falsch?

Ich finde in der class.tx_ttproducts_info.php auch keine Stelle, wo das Feld gender aus feuser gelesen wird.

Gruß KLAUS

kwottkam ·

Hallo zusammen,

ich habe das Problem gelöst, indem ich am Code ein kleine Änderung durchgeführt habe. Ist natürlich nicht das beste, aber für mich brauchbar.

Datei class..tx_ttproducts_info.php

foreach ($fieldArray as $k => $field)	{
	$this->infoArray['billing'][$field] = ($this->infoArray['billing'][$field] ? $this->infoArray['billing'][$field]: $TSFE->fe_user->user[$field]);
}
//Klaus Wottka-Märkl
$this->infoArray['billing']['salutation'] = ($this->infoArray['billing']['salutation'] ? $this->infoArray['billing']['salutation']: $TSFE->fe_user->user['gender']);
$this->infoArray['delivery']['salutation'] = ($this->infoArray['delivery']['salutation'] ? $this->infoArray['delivery']['salutation']: $TSFE->fe_user->user['gender']);

Problem lag meiner Erkenntnis daran, dass die Anrede in tt_products "Salutation" heißt, in feuser_registration aber "gender". Damit wird beim durchlaufen der foreach Schleife salutation immer auf NULL gesetzt.

Außerdem hatte ich noch das Problem, dass der Marker ###DELIVERY_SALUTATION### mir immer ein Select Feld mit Namen recs[deliveryinfo][salutaion] erzeugt hat. Kommt wohl aus der Historie..?

Gelöst für mich mit:

//Klaus Wottka-Märkl if Hinzugefügt, weil delivery OHNE info gesetzt werden muss
if ($type == "delivery")
	$typeSalutationText = tx_ttproducts_form_div::createSelect ($this->pibase, $TCA['sys_products_orders']['columns']['salutation']['config']['items'], 'recs['.$type.'][salutation]', $row['salutation'], array());
else
	$typeSalutationText = tx_ttproducts_form_div::createSelect ($this->pibase, $TCA['sys_products_orders']['columns']['salutation']['config']['items'], 'recs['.$type.'info][salutation]', $row['salutation'], array());