[TYPO3-commerce] Second checkbox for disclaimer / second block of terms

Egemen Erol e.erol at epower3.de
Sat Mar 30 13:48:47 CET 2013


Hi,

did some work on class.tx_commerce_pi3.php:

806c806,807
< 		if ($this->conf['terms.']['checkedDefault']) {
---
> 		
> 		if ($this->conf['terms.']['checkedDefault'] ||
$this->piVars['terms'] == 'termschecked') {
822a824,841
> 		
> 		
> 		if ($this->formError['terms2']) {
> 			$markerArray['###ERROR_TERMS_ACCEPT2###'] =
$this->cObj->dataWrap($this->formError['terms2'],
$this->conf['terms.']['errorWrap']);
> 		} else {
> 			$markerArray['###ERROR_TERMS_ACCEPT2###'] = '';
> 			   }
> 	   
> 		if ($this->conf['terms2.']['checkedDefault'] ||
$this->piVars['terms2'] == 'termschecked') {
> 		   	$termsChecked2 = 'checked';
> 	    }
> 	
> 		$markerArray['###LISTING_TERMS_ACCEPT_LABEL2###'] =
$this->pi_getLL('termstext2');
> 		$markerArray['###LISTING_TERMS_ACCEPT_FIELD2###'] = '<input
type="checkbox" name="' . $this->prefixId . '[terms2]" value="termschecked"
' . $termsChecked2 . ' />';
> 		
> 		
> 		
> 		
841c860
< 	}
---
> 	} 
873,875c892,904
< 		// Check if terms are accepted
<                 if ((!$paymentDone && (empty($this->piVars['terms'])) ||
($this->piVars['terms'] != 'termschecked'))) {
< 			$this->formError['terms'] =
$this->pi_getLL('error_terms_not_accepted');
---
> 		// Check if ANY of the terms are NOT accepted
>         if ((!$paymentDone && (empty($this->piVars['terms'])) ||
($this->piVars['terms'] != 'termschecked')) ||
(empty($this->piVars['terms2'])) || ($this->piVars['terms2'] !=
'termschecked')) {
> 			
>             // Fill in error message for terms if box for terms is NOT
checked or is empty
>             if ((empty($this->piVars['terms'])) || ($this->piVars['terms']
!= 'termschecked')) {    	
>                 $this->formError['terms'] =
$this->pi_getLL('error_terms_not_accepted');
>             }
> 					
>             // Fill in error message for terms2 if box for terms2 is NOT
checked or is empty
> 		    if ((empty($this->piVars['terms2'])) ||
($this->piVars['terms2'] != 'termschecked')) {
> 		        $this->formError['terms2'] =
$this->pi_getLL('error_terms_not_accepted2');
> 		    }
> 					
878c907,917
< 				$this->formError['terms'] =
$this->pi_getLL('error_terms_not_accepted');
---
> 			
> 			    // Fill in error message for terms if box for
terms is NOT checked
> 			    if ((empty($this->piVars['terms'])) ||
($this->piVars['terms'] != 'termschecked')) {
> 			        $this->formError['terms'] =
$this->pi_getLL('error_terms_not_accepted');
> 			    }
> 				
> 			    // Fill in error message for terms2 if box for
terms2 is NOT checked
> 			    if ((empty($this->piVars['terms2'])) ||
($this->piVars['terms2'] != 'termschecked')) {
> 			        $this->formError['terms2'] =
$this->pi_getLL('error_terms_not_accepted2');
> 			    }
> 		
884c923,924
< 
---
>         
> 				

You also have to add i.e. :

_LOCAL_LANG.de.termstext2 = <p class="norm_absatz"> </p> "Ich stimme der
externen <a target="_new" href="index.php?id=61">Abrechnung</a> zu"
_LOCAL_LANG.de.error_terms_not_accepted2 = Bitte stimmen sie der externen
Abrechnung zu

or according lines to your setup.ts and also to your checkout template:

 <span class="error">###ERROR_TERMS_ACCEPT###</span>
 <span class="error">###ERROR_TERMS_ACCEPT2###</span>
<p class="com-chkout-listing-terms">###LISTING_TERMS_ACCEPT_LABEL###
###LISTING_TERMS_ACCEPT_FIELD###</p>
<p class="com-chkout-listing-terms">###LISTING_TERMS_ACCEPT_LABEL2###
###LISTING_TERMS_ACCEPT_FIELD2###</p>

The lines with "Accept2" and "Label2" are the ones newly added near the old
labels displaying the old checkbox. Seems to work fine, maybe someone can
look it over.

Regards

Egemen

e.erol at epower3.de

-----Ursprüngliche Nachricht-----
Von: typo3-project-commerce-bounces at lists.typo3.org
[mailto:typo3-project-commerce-bounces at lists.typo3.org] Im Auftrag von
Egemen Erol
Gesendet: Freitag, 22. März 2013 14:17
An: typo3-project-commerce at lists.typo3.org
Betreff: [TYPO3-commerce] Second checkbox for disclaimer / second block of
terms

Hi everybody,

 

first of all thanks to the contributors for the great work. I'm running a
shop at www.rehamedia.de. I need a second checkbox on the final page of the
checkout for disclaimer /  second block of terms. I'm especially referring
to the thread
http://lists.typo3.org/pipermail/typo3-project-commerce/2013-January/thread.
html#4028 , but as far as I can see there hasn't been a change in the
template even in the newest version 0.13.13 (I'm running 0.13.0).

 

Am I missing something? Is there a quick solution? I would be glad for any
help, before I start exploring the code myself, more or less successfully.

Regards

Egemen Erol



 

_______________________________________________
TYPO3-project-commerce mailing list
TYPO3-project-commerce at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce



More information about the TYPO3-project-commerce mailing list