[TYPO3-commerce] sr_feuser_register and Add new adress

robelix roland at robelix.com
Wed Nov 21 19:48:30 CET 2007


Michiel Roos wrote:
> emanuel at mrbrown.se wrote:
>> Hi list!
>>
>> I'm using sr_feuser_register to register and edit commerce user profiles.
>> No problem with this setup until the customer reaches checkout... When a
>> user whants to add a diferent delivery address from billing address the
>> problems are starting to show. The fe_user form doesn't understand that a
>> new address is about to be created, instead of a blank form the logged
>> unser information is showing and I guess in editmode? Any one else with
>> this problem? Can't find any information in the list!?
> 
> Hi Emanuel,
> 
> I am unable to reproduce your problem. I also use frontend user 
> registration. The only problem I can see is that it is not possible to 
> modify the delivery address using the frontend user registration form. 
> You can only change the delivery address using commerce address management.
> 
> Can you try posting the exact steps to reproduce your setup and the 
> errors you get?


I think I know what he means - and it's not an error, it's just
inconvenient. After registering the user comes to address management and
has to enter the address again.

I solved it by automatically adding the address from fe_user into tt_address

in pi4/class.tx_commerce_pi4.php at the end of the function getAddresses
(just before the return $result;) add:



		if (!$result) {
			foreach($this->fieldList as $fN) {
				switch($fN) {
					case 'name':
						$this->piVars[$fN] = $GLOBALS['TSFE']->fe_user->user['first_name'];
					break;
					case 'surname':
						$this->piVars[$fN] = $GLOBALS['TSFE']->fe_user->user['last_name'];
					break;
					case 'country':
						$this->piVars[$fN] =
$GLOBALS['TSFE']->fe_user->user['static_info_country'];
					break;
					default:
						$this->piVars[$fN] = $GLOBALS['TSFE']->fe_user->user[$fN];
					break;
				}
			}
			$this->saveAddressData(true, $addressType);
			return $this->getAddresses($userId, $addressType);
		}




...and make sure the address fields are required in the user registration!



More information about the TYPO3-project-commerce mailing list