[TYPO3-commerce] no new address possible

Dimitri Kšoenig dk at cabag.ch
Wed Sep 2 15:00:59 CEST 2009


we had the same problem except of going live and everything works fine.
commerce 0.9.8 has a bug in commerce_pi4 which is responsible for 
address management. there the backpid pivar is used as page for the form 
action field. so any change will be sent to the page from which you are 
coming. and if that page does not contain a commerce_pi4 plugin no 
change will be saved.

there are several solutions:
	1. in your checkout page you put a link to the address management page 
which does not contain a backpid in the url. there you make any change 
you want and click on a link which brings you back to your checkout page.
	2. in your checkout page you put the commerce_pi4 address management 
plugin above your checkout plugin and set it to display none so any 
change will be intercepted by the commerce_pi4 plugin and when the 
checkout plugin fetches the addresses you get what you want.
	3. you update to the svn version :-)
	4. you replace in the class.tx_commerce_pi4.php, method 
"getAddressForm" the following:

old:
----
			// get action link
		if ((int)$this->piVars['backpid']>0){
			$link = $this->pi_getPageLink($this->piVars['backpid']);
		} else {
			$link = '';
		}

		return '<form method="post" action="' .$link .'">' 
.$this->cObj->substituteMarkerArray($tplBase, $baseMA) .'</form>';

new:
----
		// Get action link
		if ((int)$this->piVars['backpid'] > 0) {
			$link = $this->pi_linkTP_keepPIvars_url();
		} else {
			$link = '';
		}

		$baseMA['###ADDRESS_FORM_BACK###'] = $this->pi_linkToPage(
			$this->pi_getLL('label_form_back', 'back'),
			$this->piVars['backpid'],
			'',
			array(
				'tx_commerce_pi3' => array(
					'step' => $GLOBALS['TSFE']->fe_user->getKey('ses', 
tx_commerce_div::generateSessionKey('currentStep'))
				)
			)
		);

		return '<form method="post" action="' . $link . '" ' . 
$this->conf[addressType . '.']['formParams'] . '>' . 
$this->cObj->substituteMarkerArray($tplBase, $baseMA) . '</form>';



-dk


More information about the TYPO3-project-commerce mailing list