Completed
Branch FET-9643-checkin-system-docume... (5f5a9c)
by
unknown
200:04 queued 188:44
created
reg_steps/attendee_information/copy_attendee_info.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <div id="spco-copy-attendee-dv" class="hide-if-no-js">
2 2
 
3 3
 	<p class="spco-copy-all-attendee-pg">
4
-		<label class="ee-checkbox-label-before ee-checkbox-label-wide"><?php  _e('Use Attendee #1\'s information for ALL attendees', 'event_espresso');?>
4
+		<label class="ee-checkbox-label-before ee-checkbox-label-wide"><?php  _e('Use Attendee #1\'s information for ALL attendees', 'event_espresso'); ?>
5 5
 			<input id="spco-copy-all-attendee-chk" class="spco-copy-all-attendee-chk ee-do-not-validate" type="checkbox" value="copy-all">
6 6
 		</label>
7 7
 	</p>
8 8
 
9
-	<p class="spco-copy-attendee-pg"><?php echo apply_filters(  'FHEE__registration_page_attendee_information__copy_attendee_pg', sprintf( __('This option allows you to use the above information for all additional attendee question fields. %sPlease note:%s some events may have additional questions that you may still be required to answer in order to complete your registration.', 'event_espresso'), '<strong>', '</strong>' )); ?></p>
9
+	<p class="spco-copy-attendee-pg"><?php echo apply_filters('FHEE__registration_page_attendee_information__copy_attendee_pg', sprintf(__('This option allows you to use the above information for all additional attendee question fields. %sPlease note:%s some events may have additional questions that you may still be required to answer in order to complete your registration.', 'event_espresso'), '<strong>', '</strong>')); ?></p>
10 10
 
11
-	<a id="display-more-attendee-copy-options" class="display-the-hidden smaller-text float-right" rel="more-attendee-copy-options" ><span class="dashicons dashicons-arrow-right"></span><?php  _e('advanced copy options', 'event_espresso');?></a>
12
-	<a id="hide-more-attendee-copy-options" class="hide-the-displayed smaller-text float-right" rel="more-attendee-copy-options" style="display: none;"><span class="dashicons dashicons-arrow-down"></span><?php  _e('basic copy options', 'event_espresso');?></a>
11
+	<a id="display-more-attendee-copy-options" class="display-the-hidden smaller-text float-right" rel="more-attendee-copy-options" ><span class="dashicons dashicons-arrow-right"></span><?php  _e('advanced copy options', 'event_espresso'); ?></a>
12
+	<a id="hide-more-attendee-copy-options" class="hide-the-displayed smaller-text float-right" rel="more-attendee-copy-options" style="display: none;"><span class="dashicons dashicons-arrow-down"></span><?php  _e('basic copy options', 'event_espresso'); ?></a>
13 13
 
14 14
 	<div id="more-attendee-copy-options-dv" class="" style="display: none;">
15 15
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 			<?php _e('Only copy the above information to the following selected additional attendees.', 'event_espresso'); ?>
18 18
 		</p>
19 19
 
20
-		<?php foreach ( $spco_copy_attendee_chk as $spco_copy_chk ) { echo $spco_copy_chk; } ?>
20
+		<?php foreach ($spco_copy_attendee_chk as $spco_copy_chk) { echo $spco_copy_chk; } ?>
21 21
 
22 22
 	</div>
23 23
 	<div class="clear-float"></div>
Please login to merge, or discard this patch.
finalize_registration/EE_SPCO_Reg_Step_Finalize_Registration.class.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_Reg_Step_Finalize_Registration
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage 	core
10
- * @author 				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_Reg_Step_Finalize_Registration
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage 	core
10
+  * @author 				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_SPCO_Reg_Step_Finalize_Registration extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * @param    EE_Checkout $checkout
21 21
 	 * @return 	\EE_SPCO_Reg_Step_Finalize_Registration
22 22
 	 */
23
-	public function __construct( EE_Checkout $checkout ) {
23
+	public function __construct(EE_Checkout $checkout) {
24 24
 		$this->_slug = 'finalize_registration';
25 25
 		$this->_name = __('Finalize Registration', 'event_espresso');
26 26
 		$this->_submit_button_text = $this->_name;
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function initialize_reg_step() {
48 48
 		// there's actually no reg form to process if this is the final step
49
-		if ( $this->is_current_step() ) {
49
+		if ($this->is_current_step()) {
50 50
 			$this->checkout->step = $_REQUEST['step'] = $this->slug();
51
-			$this->checkout->action = $_REQUEST[ 'action' ] = 'process_reg_step';
51
+			$this->checkout->action = $_REQUEST['action'] = 'process_reg_step';
52 52
 			$this->checkout->generate_reg_form = false;
53 53
 		}
54 54
 		return true;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function process_reg_step() {
73 73
 		// ensure all data gets refreshed from the db
74
-		$this->checkout->refresh_all_entities( true );
74
+		$this->checkout->refresh_all_entities(true);
75 75
 		// ensures that all details and statuses for transaction, registration, and payments are updated
76 76
 		$txn_update_params = $this->_finalize_transaction();
77 77
 		// DEBUG LOG
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 		//	)
86 86
 		//);
87 87
 		// set a hook point
88
-		do_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', $this->checkout, $txn_update_params );
88
+		do_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', $this->checkout, $txn_update_params);
89 89
 		// check if transaction has a primary registrant and that it has a related Attendee object
90
-		if ( $this->checkout->transaction_has_primary_registrant() ) {
90
+		if ($this->checkout->transaction_has_primary_registrant()) {
91 91
 			// setup URL for redirect
92 92
 			$this->checkout->redirect_url = add_query_arg(
93
-				array( 'e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link() ),
93
+				array('e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link()),
94 94
 				$this->checkout->thank_you_page_url
95 95
 			);
96 96
 		} else {
97
-			EE_Error::add_error( __( 'A valid Primary Registration for this Transaction could not be found.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
97
+			EE_Error::add_error(__('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
98 98
 			$this->checkout->redirect = false;
99 99
 			$this->checkout->continue_reg = false;
100 100
 			return false;
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 		// you don't have to go home but you can't stay here !
103 103
 		$this->checkout->redirect = true;
104 104
 		$this->checkout->continue_reg = true;
105
-		$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
106
-		if ( ! ( $this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site() ) ) {
105
+		$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
106
+		if ( ! ($this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site())) {
107 107
 			// mark this reg step as completed
108 108
 			$this->set_completed();
109 109
 		}
@@ -120,24 +120,24 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	protected function _finalize_transaction() {
122 122
 		/** @type EE_Transaction_Processor $transaction_processor */
123
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
123
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
124 124
 		//set revisit flag in txn processor
125
-		$transaction_processor->set_revisit( $this->checkout->revisit );
125
+		$transaction_processor->set_revisit($this->checkout->revisit);
126 126
 		// at this point we'll consider a TXN to not have been abandoned
127
-		$transaction_processor->toggle_abandoned_transaction_status( $this->checkout->transaction );
128
-		if ( $this->checkout->cart instanceof EE_Cart ) {
127
+		$transaction_processor->toggle_abandoned_transaction_status($this->checkout->transaction);
128
+		if ($this->checkout->cart instanceof EE_Cart) {
129 129
 			// save TXN data to the cart
130
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $this->checkout->transaction->ID() );
130
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($this->checkout->transaction->ID());
131 131
 		}
132 132
 		/** @type EE_Transaction_Payments $transaction_payments */
133
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
133
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
134 134
 		// maybe update status, but don't save transaction just yet
135
-		$transaction_payments->update_transaction_status_based_on_total_paid( $this->checkout->transaction, false );
135
+		$transaction_payments->update_transaction_status_based_on_total_paid($this->checkout->transaction, false);
136 136
 		// If the selected method of payment used an off-site gateway...
137
-		if ( $this->checkout->payment_method instanceof EE_Payment_Method ) {
138
-			$is_revisit = filter_var( $this->checkout->revisit, FILTER_VALIDATE_BOOLEAN );
139
-			if ( $this->checkout->payment_method->is_off_site() ) {
140
-				$gateway= $this->checkout->payment_method->type_obj()->get_gateway();
137
+		if ($this->checkout->payment_method instanceof EE_Payment_Method) {
138
+			$is_revisit = filter_var($this->checkout->revisit, FILTER_VALIDATE_BOOLEAN);
139
+			if ($this->checkout->payment_method->is_off_site()) {
140
+				$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
141 141
 				if (
142 142
 					! $is_revisit
143 143
 					&& $gateway instanceof EE_Offsite_Gateway
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 					)
148 148
 				) {
149 149
 					// first time through SPCO and we are processing the payment notification NOW
150
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
150
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
151 151
 				} else {
152 152
 					// do NOT trigger notifications because this is a revisit, OR it was already done during the IPN
153
-					remove_all_filters( 'FHEE__EED_Messages___maybe_registration__deliver_notifications' );
153
+					remove_all_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications');
154 154
 					add_filter(
155 155
 						'FHEE__EED_Messages___maybe_registration__deliver_notifications',
156 156
 						'__return_false',
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
 				}
160 160
 			} else if (
161 161
 				// if SPCO revisit and TXN status has changed due to a payment
162
-				$is_revisit && ( $this->checkout->txn_status_updated || $this->checkout->any_reg_status_updated() )
162
+				$is_revisit && ($this->checkout->txn_status_updated || $this->checkout->any_reg_status_updated())
163 163
 			) {
164 164
 				// send out notifications
165
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
166
-			} else if ( ! $is_revisit ) {
167
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
165
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
166
+			} else if ( ! $is_revisit) {
167
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
168 168
 			}
169 169
 		}
170 170
 		// this will result in the base session properties getting saved to the TXN_Session_data field
171
-		$this->checkout->transaction->set_txn_session_data( EE_Registry::instance()->SSN->get_session_data( null, true ));
171
+		$this->checkout->transaction->set_txn_session_data(EE_Registry::instance()->SSN->get_session_data(null, true));
172 172
 
173 173
 		// update the TXN if payment conditions have changed
174 174
 		return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment(
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 * @return boolean
186 186
 	 */
187 187
 	public function update_reg_step() {
188
-		EE_Error::doing_it_wrong( __CLASS__ . '::' . __FILE__, __( 'Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0' );
188
+		EE_Error::doing_it_wrong(__CLASS__.'::'.__FILE__, __('Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0');
189 189
 	 }
190 190
 
191 191
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
 
171 171
 
172 172
 	/**
173
-	 * @return boolean
173
+	 * @return boolean|null
174 174
 	 */
175 175
 	public function update_reg_step() {
176 176
 		EE_Error::doing_it_wrong( __CLASS__ . '::' . __FILE__, __( 'Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0' );
Please login to merge, or discard this patch.
reg_steps/payment_options/EE_SPCO_Reg_Step_Payment_Options.class.php 4 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1214,9 +1214,9 @@
 block discarded – undo
1214 1214
 						$form_section = $validation_error->get_form_section();
1215 1215
 						if( $form_section instanceof EE_Form_Input_Base ){
1216 1216
 							$label = $form_section->html_label_text();
1217
-						}elseif( $form_section instanceof EE_Form_Section_Base ){
1217
+						} elseif( $form_section instanceof EE_Form_Section_Base ){
1218 1218
 							$label = $form_section->name();
1219
-						}else{
1219
+						} else{
1220 1220
 							$label = __( 'Validation Error', 'event_espresso' );
1221 1221
 						}
1222 1222
 						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage() );
Please login to merge, or discard this patch.
Spacing   +372 added lines, -372 removed lines patch added patch discarded remove patch
@@ -34,15 +34,15 @@  discard block
 block discarded – undo
34 34
 	 *  @return 	void
35 35
 	 */
36 36
 	public static function set_hooks() {
37
-		add_filter( 'FHEE__SPCO__EE_Line_Item_Filter_Collection', array( 'EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters' ) );
38
-		add_action( 'wp_ajax_switch_spco_billing_form', array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' ));
39
-		add_action( 'wp_ajax_nopriv_switch_spco_billing_form', array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' ));
40
-		add_action( 'wp_ajax_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ));
41
-		add_action( 'wp_ajax_nopriv_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ));
42
-		add_action( 'wp_ajax_get_transaction_details_for_gateways', array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' ) );
43
-		add_action( 'wp_ajax_nopriv_get_transaction_details_for_gateways', array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' )
37
+		add_filter('FHEE__SPCO__EE_Line_Item_Filter_Collection', array('EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters'));
38
+		add_action('wp_ajax_switch_spco_billing_form', array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form'));
39
+		add_action('wp_ajax_nopriv_switch_spco_billing_form', array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form'));
40
+		add_action('wp_ajax_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details'));
41
+		add_action('wp_ajax_nopriv_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details'));
42
+		add_action('wp_ajax_get_transaction_details_for_gateways', array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details'));
43
+		add_action('wp_ajax_nopriv_get_transaction_details_for_gateways', array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')
44 44
 		);
45
-		add_filter( 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array( 'EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method' ), 10, 1 );
45
+		add_filter('FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array('EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method'), 10, 1);
46 46
 	}
47 47
 
48 48
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 * 	ajax switch_spco_billing_form
52 52
 	 */
53 53
 	public static function switch_spco_billing_form() {
54
-		EED_Single_Page_Checkout::process_ajax_request( 'switch_payment_method' );
54
+		EED_Single_Page_Checkout::process_ajax_request('switch_payment_method');
55 55
 	}
56 56
 
57 57
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * 	ajax save_payer_details
61 61
 	 */
62 62
 	public static function save_payer_details() {
63
-		EED_Single_Page_Checkout::process_ajax_request( 'save_payer_details_via_ajax' );
63
+		EED_Single_Page_Checkout::process_ajax_request('save_payer_details_via_ajax');
64 64
 	}
65 65
 
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * 	ajax get_transaction_details
70 70
 	 */
71 71
 	public static function get_transaction_details() {
72
-		EED_Single_Page_Checkout::process_ajax_request( 'get_transaction_details_for_gateways' );
72
+		EED_Single_Page_Checkout::process_ajax_request('get_transaction_details_for_gateways');
73 73
 	}
74 74
 
75 75
 
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 	 * @param    EE_Checkout $checkout
98 98
 	 * @return    \EE_SPCO_Reg_Step_Payment_Options
99 99
 	 */
100
-	public function __construct( EE_Checkout $checkout ) {
100
+	public function __construct(EE_Checkout $checkout) {
101 101
 		$this->_slug = 'payment_options';
102 102
 		$this->_name = __('Payment Options', 'event_espresso');
103
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'payment_options_main.template.php';
103
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'payment_options_main.template.php';
104 104
 		$this->checkout = $checkout;
105 105
 		$this->_reset_success_message();
106
-		$this->set_instructions( __('Please select a method of payment and provide any necessary billing information before proceeding.', 'event_espresso'));
106
+		$this->set_instructions(__('Please select a method of payment and provide any necessary billing information before proceeding.', 'event_espresso'));
107 107
 	}
108 108
 
109 109
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	/**
121 121
 	 * @param null $line_item_display
122 122
 	 */
123
-	public function set_line_item_display( $line_item_display ) {
123
+	public function set_line_item_display($line_item_display) {
124 124
 		$this->line_item_display = $line_item_display;
125 125
 	}
126 126
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	/**
139 139
 	 * @param boolean $handle_IPN_in_this_request
140 140
 	 */
141
-	public function set_handle_IPN_in_this_request( $handle_IPN_in_this_request ) {
142
-		$this->handle_IPN_in_this_request = filter_var( $handle_IPN_in_this_request, FILTER_VALIDATE_BOOLEAN );
141
+	public function set_handle_IPN_in_this_request($handle_IPN_in_this_request) {
142
+		$this->handle_IPN_in_this_request = filter_var($handle_IPN_in_this_request, FILTER_VALIDATE_BOOLEAN);
143 143
 	}
144 144
 
145 145
 
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
 	 * @return void
150 150
 	 */
151 151
 	public function translate_js_strings() {
152
-		EE_Registry::$i18n_js_strings['no_payment_method'] = __( 'Please select a method of payment in order to continue.', 'event_espresso' );
153
-		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'A valid method of payment could not be determined. Please refresh the page and try again.', 'event_espresso' );
154
-		EE_Registry::$i18n_js_strings['forwarding_to_offsite'] = __( 'Forwarding to Secure Payment Provider.', 'event_espresso' );
152
+		EE_Registry::$i18n_js_strings['no_payment_method'] = __('Please select a method of payment in order to continue.', 'event_espresso');
153
+		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('A valid method of payment could not be determined. Please refresh the page and try again.', 'event_espresso');
154
+		EE_Registry::$i18n_js_strings['forwarding_to_offsite'] = __('Forwarding to Secure Payment Provider.', 'event_espresso');
155 155
 	}
156 156
 
157 157
 
@@ -180,20 +180,20 @@  discard block
 block discarded – undo
180 180
 			// 	$ 0.00 transactions (no payment required)
181 181
 			! $this->checkout->payment_required()
182 182
 			// but do NOT remove if current action being called belongs to this reg step
183
-			&& ! is_callable( array( $this, $this->checkout->action ) )
183
+			&& ! is_callable(array($this, $this->checkout->action))
184 184
 			&& ! $this->completed()
185 185
 		) {
186 186
 			// and if so, then we no longer need the Payment Options step
187
-			if ( $this->is_current_step() ) {
187
+			if ($this->is_current_step()) {
188 188
 				$this->checkout->generate_reg_form = false;
189 189
 			}
190
-			$this->checkout->remove_reg_step( $this->_slug );
190
+			$this->checkout->remove_reg_step($this->_slug);
191 191
 			// DEBUG LOG
192 192
 			//$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ );
193 193
 			return false;
194 194
 		}
195 195
 		// load EEM_Payment_Method
196
-		EE_Registry::instance()->load_model( 'Payment_Method' );
196
+		EE_Registry::instance()->load_model('Payment_Method');
197 197
 		// get all active payment methods
198 198
 		$this->checkout->available_payment_methods = EEM_Payment_Method::instance()->get_all_for_transaction(
199 199
 			$this->checkout->transaction, EEM_Payment_Method::scope_cart
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 * @return bool
208 208
 	 */
209 209
 	public function generate_reg_form() {
210
-		EE_Registry::instance()->load_helper( 'HTML' );
210
+		EE_Registry::instance()->load_helper('HTML');
211 211
 		// reset in case someone changes their mind
212 212
 		$this->_reset_selected_method_of_payment();
213 213
 		// set some defaults
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
 		$sold_out_events = array();
219 219
 		$reg_count = 0;
220 220
 		// loop thru registrations to gather info
221
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
222
-		foreach ( $registrations as $registration ) {
221
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
222
+		foreach ($registrations as $registration) {
223 223
 			/** @var $registration EE_Registration */
224 224
 			$reg_count++;
225 225
 			// if returning registrant is Approved then do NOT do this
226
-			if ( ! ( $this->checkout->revisit && $registration->status_ID() == EEM_Registration::status_id_approved )) {
227
-				if ( $registration->event()->is_sold_out() || $registration->event()->is_sold_out( true )) {
226
+			if ( ! ($this->checkout->revisit && $registration->status_ID() == EEM_Registration::status_id_approved)) {
227
+				if ($registration->event()->is_sold_out() || $registration->event()->is_sold_out(true)) {
228 228
 					// add event to list of events that are sold out
229
-					$sold_out_events[ $registration->event()->ID() ] = $registration->event();
229
+					$sold_out_events[$registration->event()->ID()] = $registration->event();
230 230
 					do_action(
231 231
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__sold_out_event',
232 232
 						$registration->event(),
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
 					);
235 235
 				}
236 236
 				// event requires admin approval
237
-				if ( $registration->status_ID() == EEM_Registration::status_id_not_approved ) {
237
+				if ($registration->status_ID() == EEM_Registration::status_id_not_approved) {
238 238
 					// add event to list of events with pre-approval reg status
239
-					$registrations_requiring_pre_approval[ $registration->ID() ] = $registration;
239
+					$registrations_requiring_pre_approval[$registration->ID()] = $registration;
240 240
 					do_action(
241 241
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_pre_approval',
242 242
 						$registration->event(),
@@ -245,29 +245,29 @@  discard block
 block discarded – undo
245 245
 				}
246 246
 			}
247 247
 			// are they allowed to pay now and is there monies owing?
248
-			if ( $registration->owes_monies_and_can_pay() ) {
249
-				$registrations_requiring_payment[ $registration->ID() ] = $registration;
248
+			if ($registration->owes_monies_and_can_pay()) {
249
+				$registrations_requiring_payment[$registration->ID()] = $registration;
250 250
 				do_action(
251 251
 					'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_payment',
252 252
 					$registration->event(),
253 253
 					$this
254 254
 				);
255
-			} else if ( ! $this->checkout->revisit && $registration->status_ID() != EEM_Registration::status_id_not_approved && $registration->ticket()->is_free()  ) {
256
-				$registrations_for_free_events[ $registration->event()->ID() ] = $registration;
255
+			} else if ( ! $this->checkout->revisit && $registration->status_ID() != EEM_Registration::status_id_not_approved && $registration->ticket()->is_free()) {
256
+				$registrations_for_free_events[$registration->event()->ID()] = $registration;
257 257
 			}
258 258
 		}
259 259
 		$subsections = array();
260 260
 		// now decide which template to load
261
-		if ( ! empty( $sold_out_events )) {
262
-			$subsections['sold_out_events'] = $this->_sold_out_events( $sold_out_events );
261
+		if ( ! empty($sold_out_events)) {
262
+			$subsections['sold_out_events'] = $this->_sold_out_events($sold_out_events);
263 263
 		}
264
-		if ( ! empty( $registrations_requiring_pre_approval )) {
265
-			$subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval( $registrations_requiring_pre_approval );
264
+		if ( ! empty($registrations_requiring_pre_approval)) {
265
+			$subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval($registrations_requiring_pre_approval);
266 266
 		}
267
-		if ( ! empty( $registrations_for_free_events ) ) {
268
-			$subsections[ 'no_payment_required' ] = $this->_no_payment_required( $registrations_for_free_events );
267
+		if ( ! empty($registrations_for_free_events)) {
268
+			$subsections['no_payment_required'] = $this->_no_payment_required($registrations_for_free_events);
269 269
 		}
270
-		if ( ! empty( $registrations_requiring_payment ) ) {
270
+		if ( ! empty($registrations_requiring_payment)) {
271 271
 			// autoload Line_Item_Display classes
272 272
 			EEH_Autoloader::register_line_item_filter_autoloaders();
273 273
 			$line_item_filter_processor = new EE_Line_Item_Filter_Processor(
@@ -278,17 +278,17 @@  discard block
 block discarded – undo
278 278
 				$this->checkout->cart->get_grand_total()
279 279
 			);
280 280
 			$filtered_line_item_tree = $line_item_filter_processor->process();
281
-			if ( $this->checkout->amount_owing > 0 ) {
281
+			if ($this->checkout->amount_owing > 0) {
282 282
 				EEH_Autoloader::register_line_item_display_autoloaders();
283
-				$this->set_line_item_display( new EE_Line_Item_Display( 'spco' ) );
284
-				$subsections[ 'payment_options' ] = $this->_display_payment_options(
283
+				$this->set_line_item_display(new EE_Line_Item_Display('spco'));
284
+				$subsections['payment_options'] = $this->_display_payment_options(
285 285
 					$this->line_item_display->display_line_item(
286 286
 						$filtered_line_item_tree,
287
-						array( 'registrations' => $registrations )
287
+						array('registrations' => $registrations)
288 288
 					)
289 289
 				);
290 290
 				$this->checkout->amount_owing = $filtered_line_item_tree->total();
291
-				$this->_apply_registration_payments_to_amount_owing( $registrations );
291
+				$this->_apply_registration_payments_to_amount_owing($registrations);
292 292
 			}
293 293
 		} else {
294 294
 			$this->_hide_reg_step_submit_button_if_revisit();
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 	 * @param \EE_Line_Item_Filter_Collection $line_item_filter_collection
322 322
 	 * @return \EE_Line_Item_Filter_Collection
323 323
 	 */
324
-	public static function add_spco_line_item_filters( EE_Line_Item_Filter_Collection $line_item_filter_collection ) {
324
+	public static function add_spco_line_item_filters(EE_Line_Item_Filter_Collection $line_item_filter_collection) {
325 325
 		$line_item_filter_collection->add(
326 326
 			new EE_Billable_Line_Item_Filter(
327 327
 				EE_Registry::instance()->SSN->checkout()->transaction->registrations(
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 				)
330 330
 			)
331 331
 		);
332
-		$line_item_filter_collection->add( new EE_Non_Zero_Line_Item_Filter() );
332
+		$line_item_filter_collection->add(new EE_Non_Zero_Line_Item_Filter());
333 333
 		return $line_item_filter_collection;
334 334
 	}
335 335
 
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
 	 * @return void
344 344
 	 */
345 345
 	protected function _hide_reg_step_submit_button_if_revisit() {
346
-		if ( $this->checkout->revisit ) {
347
-			add_filter( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string' );
346
+		if ($this->checkout->revisit) {
347
+			add_filter('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string');
348 348
 		}
349 349
 	}
350 350
 
@@ -355,12 +355,12 @@  discard block
 block discarded – undo
355 355
 	 * @param \EE_Event[] $sold_out_events_array
356 356
 	 * @return \EE_Form_Section_Proper
357 357
 	 */
358
-	private function _sold_out_events( $sold_out_events_array = array() ) {
358
+	private function _sold_out_events($sold_out_events_array = array()) {
359 359
 		// set some defaults
360 360
 		$this->checkout->selected_method_of_payment = 'events_sold_out';
361 361
 		$sold_out_events = '';
362
-		foreach ( $sold_out_events_array as $sold_out_event ) {
363
-			$sold_out_events .= EEH_HTML::li( EEH_HTML::span( $sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' ));
362
+		foreach ($sold_out_events_array as $sold_out_event) {
363
+			$sold_out_events .= EEH_HTML::li(EEH_HTML::span($sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text'));
364 364
 		}
365 365
 		return new EE_Form_Section_Proper(
366 366
 			array(
@@ -372,14 +372,14 @@  discard block
 block discarded – undo
372 372
 				),
373 373
 				'layout_strategy'		=> new EE_Template_Layout(
374 374
 					array(
375
-						'layout_template_file' 	=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'sold_out_events.template.php', // layout_template
375
+						'layout_template_file' 	=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'sold_out_events.template.php', // layout_template
376 376
 						'template_args'  				=> apply_filters(
377 377
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
378 378
 							array(
379 379
 								'sold_out_events' 			=> $sold_out_events,
380 380
 								'sold_out_events_msg' 	=> apply_filters(
381 381
 									'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__sold_out_events_msg',
382
-									__( 'It appears that the event you were about to make a payment for has sold out since you first registered. If you have already made a partial payment towards this event, please contact the event administrator for a refund.', 'event_espresso' )
382
+									__('It appears that the event you were about to make a payment for has sold out since you first registered. If you have already made a partial payment towards this event, please contact the event administrator for a refund.', 'event_espresso')
383 383
 								)
384 384
 							)
385 385
 						)
@@ -396,14 +396,14 @@  discard block
 block discarded – undo
396 396
 	 * @param array $registrations_requiring_pre_approval
397 397
 	 * @return \EE_Form_Section_Proper
398 398
 	 */
399
-	private function _registrations_requiring_pre_approval( $registrations_requiring_pre_approval = array()) {
399
+	private function _registrations_requiring_pre_approval($registrations_requiring_pre_approval = array()) {
400 400
 		$events_requiring_pre_approval = '';
401
-		foreach ( $registrations_requiring_pre_approval as $registration ) {
402
-			if ( $registration instanceof EE_Registration && $registration->event() instanceof EE_Event ) {
403
-				$events_requiring_pre_approval[ $registration->event()->ID() ] = EEH_HTML::li(
404
-					EEH_HTML::span( '', '', 'dashicons dashicons-marker ee-icon-size-16 orange-text'
401
+		foreach ($registrations_requiring_pre_approval as $registration) {
402
+			if ($registration instanceof EE_Registration && $registration->event() instanceof EE_Event) {
403
+				$events_requiring_pre_approval[$registration->event()->ID()] = EEH_HTML::li(
404
+					EEH_HTML::span('', '', 'dashicons dashicons-marker ee-icon-size-16 orange-text'
405 405
 					)
406
-					. EEH_HTML::span( $registration->event()->name(), '', 'orange-text' )
406
+					. EEH_HTML::span($registration->event()->name(), '', 'orange-text')
407 407
 				);
408 408
 			}
409 409
 		}
@@ -415,14 +415,14 @@  discard block
 block discarded – undo
415 415
 				),
416 416
 				'layout_strategy'		=> new EE_Template_Layout(
417 417
 					array(
418
-						'layout_template_file' 	=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'events_requiring_pre_approval.template.php', // layout_template
418
+						'layout_template_file' 	=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'events_requiring_pre_approval.template.php', // layout_template
419 419
 						'template_args'  				=> apply_filters(
420 420
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
421 421
 							array(
422
-								'events_requiring_pre_approval' 			=> implode( '', $events_requiring_pre_approval ),
422
+								'events_requiring_pre_approval' 			=> implode('', $events_requiring_pre_approval),
423 423
 								'events_requiring_pre_approval_msg' 	=> apply_filters(
424 424
 									'FHEE__EE_SPCO_Reg_Step_Payment_Options___events_requiring_pre_approval__events_requiring_pre_approval_msg',
425
-									__( 'The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso' )
425
+									__('The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso')
426 426
 								)
427 427
 							)
428 428
 						),
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 * @param \EE_Event[] $registrations_for_free_events
441 441
 	 * @return \EE_Form_Section_Proper
442 442
 	 */
443
-	private function _no_payment_required( $registrations_for_free_events = array() ) {
443
+	private function _no_payment_required($registrations_for_free_events = array()) {
444 444
 		// set some defaults
445 445
 		$this->checkout->selected_method_of_payment = 'no_payment_required';
446 446
 		// generate no_payment_required form
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 				),
453 453
 				'layout_strategy' 	=> new EE_Template_Layout(
454 454
 					array(
455
-						'layout_template_file' 	=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'no_payment_required.template.php', // layout_template
455
+						'layout_template_file' 	=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'no_payment_required.template.php', // layout_template
456 456
 						'template_args'  				=> apply_filters(
457 457
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___no_payment_required__template_args',
458 458
 							array(
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 								'registrations' => array(),
461 461
 								'ticket_count' 	=> array(),
462 462
 								'registrations_for_free_events' 	=> $registrations_for_free_events,
463
-								'no_payment_required_msg' => EEH_HTML::p( __( 'This is a free event, so no billing will occur.', 'event_espresso' ))
463
+								'no_payment_required_msg' => EEH_HTML::p(__('This is a free event, so no billing will occur.', 'event_espresso'))
464 464
 							)
465 465
 						),
466 466
 					)
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	 * @param string $transaction_details
478 478
 	 * @return \EE_Form_Section_Proper
479 479
 	 */
480
-	private function _display_payment_options( $transaction_details = '' ) {
480
+	private function _display_payment_options($transaction_details = '') {
481 481
 		// has method_of_payment been set by no-js user?
482 482
 		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment();
483 483
 		// build payment options form
@@ -489,20 +489,20 @@  discard block
 block discarded – undo
489 489
 						'before_payment_options' => apply_filters(
490 490
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__before_payment_options',
491 491
 							new EE_Form_Section_Proper(
492
-								array( 'layout_strategy'	=> new EE_Div_Per_Section_Layout() )
492
+								array('layout_strategy'	=> new EE_Div_Per_Section_Layout())
493 493
 							)
494 494
 						),
495 495
 						'payment_options' => $this->_setup_payment_options(),
496 496
 						'after_payment_options' => apply_filters(
497 497
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__after_payment_options',
498 498
 							new EE_Form_Section_Proper(
499
-								array( 'layout_strategy'	=> new EE_Div_Per_Section_Layout() )
499
+								array('layout_strategy'	=> new EE_Div_Per_Section_Layout())
500 500
 							)
501 501
 						),
502 502
 						'default_hidden_inputs' => $this->reg_step_hidden_inputs(),
503
-						'extra_hidden_inputs' 	=> $this->_extra_hidden_inputs( FALSE )
503
+						'extra_hidden_inputs' 	=> $this->_extra_hidden_inputs(FALSE)
504 504
 					),
505
-					'layout_strategy'	=> new EE_Template_Layout( array(
505
+					'layout_strategy'	=> new EE_Template_Layout(array(
506 506
 							'layout_template_file' 	=> $this->_template,
507 507
 							'template_args'  				=> apply_filters(
508 508
 								'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__template_args',
@@ -526,11 +526,11 @@  discard block
 block discarded – undo
526 526
 	 * @param bool $no_payment_required
527 527
 	 * @return \EE_Form_Section_Proper
528 528
 	 */
529
-	private function _extra_hidden_inputs( $no_payment_required = TRUE ) {
529
+	private function _extra_hidden_inputs($no_payment_required = TRUE) {
530 530
 
531 531
 		return new EE_Form_Section_Proper(
532 532
 			array(
533
-				'html_id' 				=> 'ee-' . $this->slug() . '-extra-hidden-inputs',
533
+				'html_id' 				=> 'ee-'.$this->slug().'-extra-hidden-inputs',
534 534
 				'layout_strategy'	=> new EE_Div_Per_Section_Layout(),
535 535
 				'subsections' 		=> array(
536 536
 					'spco_no_payment_required' => new EE_Hidden_Input(
@@ -563,16 +563,16 @@  discard block
 block discarded – undo
563 563
 	 * @access    protected
564 564
 	 * @return    void
565 565
 	 */
566
-	protected function _apply_registration_payments_to_amount_owing( $registrations ) {
566
+	protected function _apply_registration_payments_to_amount_owing($registrations) {
567 567
 		$payments = array();
568
-		foreach ( $registrations as $registration ) {
569
-			if ( $registration instanceof EE_Registration && $registration->owes_monies_and_can_pay() ) {
568
+		foreach ($registrations as $registration) {
569
+			if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) {
570 570
 				$payments = $payments + $registration->registration_payments();
571 571
 			}
572 572
 		}
573
-		if ( ! empty( $payments ) ) {
574
-			foreach ( $payments as $payment ) {
575
-				if ( $payment instanceof EE_Registration_Payment ) {
573
+		if ( ! empty($payments)) {
574
+			foreach ($payments as $payment) {
575
+				if ($payment instanceof EE_Registration_Payment) {
576 576
 					$this->checkout->amount_owing -= $payment->amount();
577 577
 				}
578 578
 			}
@@ -587,9 +587,9 @@  discard block
 block discarded – undo
587 587
 	 * @param 	bool $force_reset
588 588
 	 * @return 	void
589 589
 	 */
590
-	private function _reset_selected_method_of_payment( $force_reset = FALSE ) {
591
-		$reset_payment_method = $force_reset ? TRUE : sanitize_text_field( EE_Registry::instance()->REQ->get( 'reset_payment_method', FALSE ));
592
-		if ( $reset_payment_method ) {
590
+	private function _reset_selected_method_of_payment($force_reset = FALSE) {
591
+		$reset_payment_method = $force_reset ? TRUE : sanitize_text_field(EE_Registry::instance()->REQ->get('reset_payment_method', FALSE));
592
+		if ($reset_payment_method) {
593 593
 			$this->checkout->selected_method_of_payment = NULL;
594 594
 			$this->checkout->payment_method = NULL;
595 595
 			$this->checkout->billing_form = NULL;
@@ -608,9 +608,9 @@  discard block
 block discarded – undo
608 608
 	 * @param string $selected_method_of_payment
609 609
 	 * 	@return 		EE_Billing_Info_Form
610 610
 	 */
611
-	private function _save_selected_method_of_payment( $selected_method_of_payment = '' ) {
612
-		$selected_method_of_payment = ! empty( $selected_method_of_payment ) ? $selected_method_of_payment : $this->checkout->selected_method_of_payment;
613
-		EE_Registry::instance()->SSN->set_session_data( array( 'selected_method_of_payment' => $selected_method_of_payment ));
611
+	private function _save_selected_method_of_payment($selected_method_of_payment = '') {
612
+		$selected_method_of_payment = ! empty($selected_method_of_payment) ? $selected_method_of_payment : $this->checkout->selected_method_of_payment;
613
+		EE_Registry::instance()->SSN->set_session_data(array('selected_method_of_payment' => $selected_method_of_payment));
614 614
 	}
615 615
 
616 616
 
@@ -623,40 +623,40 @@  discard block
 block discarded – undo
623 623
 		// load payment method classes
624 624
 		$this->checkout->available_payment_methods = $this->_get_available_payment_methods();
625 625
 		// switch up header depending on number of available payment methods
626
-		$payment_method_header = count( $this->checkout->available_payment_methods ) > 1
627
-			? apply_filters( 'FHEE__registration_page_payment_options__method_of_payment_hdr', __( 'Please Select Your Method of Payment', 'event_espresso' ))
628
-			: apply_filters( 'FHEE__registration_page_payment_options__method_of_payment_hdr', __( 'Method of Payment', 'event_espresso' ));
626
+		$payment_method_header = count($this->checkout->available_payment_methods) > 1
627
+			? apply_filters('FHEE__registration_page_payment_options__method_of_payment_hdr', __('Please Select Your Method of Payment', 'event_espresso'))
628
+			: apply_filters('FHEE__registration_page_payment_options__method_of_payment_hdr', __('Method of Payment', 'event_espresso'));
629 629
 		$available_payment_methods = array(
630 630
 			// display the "Payment Method" header
631 631
 			'payment_method_header' => new EE_Form_Section_HTML(
632
-				EEH_HTML::h4 ( $payment_method_header, 'method-of-payment-hdr' )
632
+				EEH_HTML::h4($payment_method_header, 'method-of-payment-hdr')
633 633
 			)
634 634
 		);
635 635
 		// the list of actual payment methods ( invoice, paypal, etc ) in a  ( slug => HTML )  format
636 636
 		$available_payment_method_options = array();
637 637
 		$default_payment_method_option = array();
638 638
 		// additional instructions to be displayed and hidden below payment methods (adding a clearing div to start)
639
-		$payment_methods_billing_info = array( new EE_Form_Section_HTML( EEH_HTML::div ( '<br />', '', '', 'clear:both;' )));
639
+		$payment_methods_billing_info = array(new EE_Form_Section_HTML(EEH_HTML::div('<br />', '', '', 'clear:both;')));
640 640
 		// loop through payment methods
641
-		foreach( $this->checkout->available_payment_methods as $payment_method ) {
642
-			if ( $payment_method instanceof EE_Payment_Method ) {
643
-				$payment_method_button = EEH_HTML::img( $payment_method->button_url(), $payment_method->name(), 'spco-payment-method-' . $payment_method->slug() . '-btn-img', 'spco-payment-method-btn-img' );
641
+		foreach ($this->checkout->available_payment_methods as $payment_method) {
642
+			if ($payment_method instanceof EE_Payment_Method) {
643
+				$payment_method_button = EEH_HTML::img($payment_method->button_url(), $payment_method->name(), 'spco-payment-method-'.$payment_method->slug().'-btn-img', 'spco-payment-method-btn-img');
644 644
 				// check if any payment methods are set as default
645 645
 				// if payment method is already selected OR nothing is selected and this payment method should be open_by_default
646
-				if (( $this->checkout->selected_method_of_payment == $payment_method->slug() ) || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default() )) {
646
+				if (($this->checkout->selected_method_of_payment == $payment_method->slug()) || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default())) {
647 647
 					$this->checkout->selected_method_of_payment = $payment_method->slug();
648 648
 					$this->_save_selected_method_of_payment();
649
-					$default_payment_method_option[ $payment_method->slug() ] =  $payment_method_button;
649
+					$default_payment_method_option[$payment_method->slug()] = $payment_method_button;
650 650
 				} else {
651
-					$available_payment_method_options[ $payment_method->slug() ] =  $payment_method_button;
651
+					$available_payment_method_options[$payment_method->slug()] = $payment_method_button;
652 652
 				}
653
-				$payment_methods_billing_info[ $payment_method->slug() . '-info' ] = $this->_payment_method_billing_info( $payment_method );
653
+				$payment_methods_billing_info[$payment_method->slug().'-info'] = $this->_payment_method_billing_info($payment_method);
654 654
 			}
655 655
 		}
656 656
 		// prepend available_payment_method_options with default_payment_method_option so that it appears first in list of PMs
657 657
 		$available_payment_method_options = $default_payment_method_option + $available_payment_method_options;
658 658
 		// now generate the actual form  inputs
659
-		$available_payment_methods['available_payment_methods'] = $this->_available_payment_method_inputs( $available_payment_method_options );
659
+		$available_payment_methods['available_payment_methods'] = $this->_available_payment_method_inputs($available_payment_method_options);
660 660
 		$available_payment_methods = $available_payment_methods + $payment_methods_billing_info;
661 661
 
662 662
 		// build the available payment methods form
@@ -676,19 +676,19 @@  discard block
 block discarded – undo
676 676
 	 * @return EE_Payment_Method[]
677 677
 	 */
678 678
 	protected function _get_available_payment_methods() {
679
-		if ( ! empty( $this->checkout->available_payment_methods )) {
679
+		if ( ! empty($this->checkout->available_payment_methods)) {
680 680
 			return $this->checkout->available_payment_methods;
681 681
 		}
682 682
 		$available_payment_methods = array();
683 683
 		// load EEM_Payment_Method
684
-		EE_Registry::instance()->load_model( 'Payment_Method' );
684
+		EE_Registry::instance()->load_model('Payment_Method');
685 685
 		/** @type EEM_Payment_Method $EEM_Payment_Method */
686 686
 		$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
687 687
 		// get all active payment methods
688
-		$payment_methods = $EEM_Payment_Method->get_all_for_transaction( $this->checkout->transaction, EEM_Payment_Method::scope_cart );
689
-		foreach ( $payment_methods as $payment_method ) {
690
-			if ( $payment_method instanceof EE_Payment_Method ) {
691
-				$available_payment_methods[ $payment_method->slug() ] = $payment_method;
688
+		$payment_methods = $EEM_Payment_Method->get_all_for_transaction($this->checkout->transaction, EEM_Payment_Method::scope_cart);
689
+		foreach ($payment_methods as $payment_method) {
690
+			if ($payment_method instanceof EE_Payment_Method) {
691
+				$available_payment_methods[$payment_method->slug()] = $payment_method;
692 692
 			}
693 693
 		}
694 694
 		return $available_payment_methods;
@@ -704,14 +704,14 @@  discard block
 block discarded – undo
704 704
 	 * @param 	array $available_payment_method_options
705 705
 	 * @return 	\EE_Form_Section_Proper
706 706
 	 */
707
-	private function _available_payment_method_inputs( $available_payment_method_options = array() ) {
707
+	private function _available_payment_method_inputs($available_payment_method_options = array()) {
708 708
 		// generate inputs
709 709
 		return new EE_Form_Section_Proper(
710 710
 			array(
711 711
 				'html_id' 				=> 'ee-available-payment-method-inputs',
712 712
 				'layout_strategy'	=> new EE_Div_Per_Section_Layout(),
713 713
 				'subsections' 		=> array(
714
-					'' => new EE_Radio_Button_Input (
714
+					'' => new EE_Radio_Button_Input(
715 715
 						$available_payment_method_options,
716 716
 						array(
717 717
 							'html_name' 				=> 'selected_method_of_payment',
@@ -735,36 +735,36 @@  discard block
 block discarded – undo
735 735
 	 * @param 	EE_Payment_Method $payment_method
736 736
 	 * @return 	\EE_Form_Section_Proper
737 737
 	 */
738
-	private function _payment_method_billing_info( EE_Payment_Method $payment_method ) {
738
+	private function _payment_method_billing_info(EE_Payment_Method $payment_method) {
739 739
 		$currently_selected = $this->checkout->selected_method_of_payment == $payment_method->slug() ? TRUE : FALSE;
740 740
 		// generate the billing form for payment method
741
-		$billing_form = $currently_selected ? $this->_get_billing_form_for_payment_method( $payment_method ) : new EE_Form_Section_HTML();
741
+		$billing_form = $currently_selected ? $this->_get_billing_form_for_payment_method($payment_method) : new EE_Form_Section_HTML();
742 742
 		$this->checkout->billing_form = $currently_selected ? $billing_form : $this->checkout->billing_form;
743 743
 		// it's all in the details
744
-		$info_html = EEH_HTML::h3 ( __( 'Important information regarding your payment', 'event_espresso' ), '', 'spco-payment-method-hdr' );
744
+		$info_html = EEH_HTML::h3(__('Important information regarding your payment', 'event_espresso'), '', 'spco-payment-method-hdr');
745 745
 		// add some info regarding the step, either from what's saved in the admin, or a default string depending on whether the PM has a billing form or not
746
-		if ( $payment_method->description() ) {
746
+		if ($payment_method->description()) {
747 747
 			$payment_method_info = $payment_method->description();
748
-		} elseif ( $billing_form instanceof EE_Billing_Info_Form ) {
749
-			$payment_method_info = sprintf( __( 'Please provide the following billing information, then click the "%1$s" button below in order to proceed.', 'event_espresso' ), $this->submit_button_text() );
748
+		} elseif ($billing_form instanceof EE_Billing_Info_Form) {
749
+			$payment_method_info = sprintf(__('Please provide the following billing information, then click the "%1$s" button below in order to proceed.', 'event_espresso'), $this->submit_button_text());
750 750
 		} else {
751
-			$payment_method_info = sprintf( __( 'Please click the "%1$s" button below in order to proceed.', 'event_espresso' ), $this->submit_button_text() );
751
+			$payment_method_info = sprintf(__('Please click the "%1$s" button below in order to proceed.', 'event_espresso'), $this->submit_button_text());
752 752
 		}
753
-		$info_html .= EEH_HTML::p (
754
-			apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_method_billing_info__payment_method_info', $payment_method_info ),
753
+		$info_html .= EEH_HTML::p(
754
+			apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_method_billing_info__payment_method_info', $payment_method_info),
755 755
 			'',
756 756
 			'spco-payment-method-desc ee-attention'
757 757
 		);
758 758
 
759 759
 		return new EE_Form_Section_Proper(
760 760
 			array(
761
-				'html_id' 					=> 'spco-payment-method-info-' . $payment_method->slug(),
761
+				'html_id' 					=> 'spco-payment-method-info-'.$payment_method->slug(),
762 762
 				'html_class' 			=> 'spco-payment-method-info-dv',
763 763
 				// only display the selected or default PM
764 764
 				'html_style' 			=> $currently_selected ? '' : 'display:none;',
765 765
 				'layout_strategy'		=> new EE_Div_Per_Section_Layout(),
766 766
 				'subsections' 			=> array(
767
-					'info' 					=> new EE_Form_Section_HTML( $info_html ),
767
+					'info' 					=> new EE_Form_Section_HTML($info_html),
768 768
 					'billing_form' 		=> $currently_selected ? $billing_form : new EE_Form_Section_HTML()
769 769
 				)
770 770
 			)
@@ -782,12 +782,12 @@  discard block
 block discarded – undo
782 782
 	 */
783 783
 	public function get_billing_form_html_for_payment_method() {
784 784
 		// how have they chosen to pay?
785
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( TRUE );
785
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(TRUE);
786 786
 		$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
787
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
787
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
788 788
 			return FALSE;
789 789
 		}
790
-		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) {
790
+		if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) {
791 791
             EE_Error::add_success(
792 792
                 apply_filters(
793 793
                     'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
@@ -796,20 +796,20 @@  discard block
 block discarded – undo
796 796
             );
797 797
         }
798 798
 		// now generate billing form for selected method of payment
799
-		$payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
799
+		$payment_method_billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
800 800
 		// fill form with attendee info if applicable
801
-		if ( $payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant() ) {
802
-			$payment_method_billing_form->populate_from_attendee( $this->checkout->transaction->primary_registration()->attendee() );
801
+		if ($payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant()) {
802
+			$payment_method_billing_form->populate_from_attendee($this->checkout->transaction->primary_registration()->attendee());
803 803
 		}
804 804
 		// and debug content
805
-		if ( $payment_method_billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base ) {
806
-			$payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings( $payment_method_billing_form );
805
+		if ($payment_method_billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base) {
806
+			$payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings($payment_method_billing_form);
807 807
 		}
808 808
 		$billing_info = $payment_method_billing_form instanceof EE_Form_Section_Proper ? $payment_method_billing_form->get_html() : '';
809
-		$this->checkout->json_response->set_return_data( array( 'payment_method_info' => $billing_info ));
809
+		$this->checkout->json_response->set_return_data(array('payment_method_info' => $billing_info));
810 810
 		// localize validation rules for main form
811 811
 		$this->checkout->current_step->reg_form->localize_validation_rules();
812
-		$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
812
+		$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
813 813
 		return TRUE;
814 814
 	}
815 815
 
@@ -822,15 +822,15 @@  discard block
 block discarded – undo
822 822
 	 * @param EE_Payment_Method $payment_method
823 823
 	 * @return \EE_Billing_Info_Form
824 824
 	 */
825
-	private function _get_billing_form_for_payment_method( EE_Payment_Method $payment_method ) {
826
-		$billing_form = $payment_method->type_obj()->billing_form( $this->checkout->transaction, array( 'amount_owing' => $this->checkout->amount_owing ) );
827
-		if ( $billing_form instanceof EE_Billing_Info_Form ) {
828
-			if ( EE_Registry::instance()->REQ->is_set( 'payment_method' )) {
829
-                if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) {
825
+	private function _get_billing_form_for_payment_method(EE_Payment_Method $payment_method) {
826
+		$billing_form = $payment_method->type_obj()->billing_form($this->checkout->transaction, array('amount_owing' => $this->checkout->amount_owing));
827
+		if ($billing_form instanceof EE_Billing_Info_Form) {
828
+			if (EE_Registry::instance()->REQ->is_set('payment_method')) {
829
+                if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) {
830 830
                     EE_Error::add_success(
831 831
                         apply_filters(
832 832
                             'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
833
-                            sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() )
833
+                            sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $payment_method->name())
834 834
                         )
835 835
                     );
836 836
                 }
@@ -855,27 +855,27 @@  discard block
 block discarded – undo
855 855
 	 * @param string 		$request_param
856 856
 	 * @return NULL|string
857 857
 	 */
858
-	private function _get_selected_method_of_payment( $required = FALSE, $request_param = 'selected_method_of_payment' ) {
858
+	private function _get_selected_method_of_payment($required = FALSE, $request_param = 'selected_method_of_payment') {
859 859
 		// is selected_method_of_payment set in the request ?
860
-		$selected_method_of_payment = EE_Registry::instance()->REQ->get( $request_param, FALSE );
861
-		if ( $selected_method_of_payment ) {
860
+		$selected_method_of_payment = EE_Registry::instance()->REQ->get($request_param, FALSE);
861
+		if ($selected_method_of_payment) {
862 862
 			// sanitize it
863
-			$selected_method_of_payment = is_array( $selected_method_of_payment ) ? array_shift( $selected_method_of_payment ) : $selected_method_of_payment;
864
-			$selected_method_of_payment = sanitize_text_field( $selected_method_of_payment );
863
+			$selected_method_of_payment = is_array($selected_method_of_payment) ? array_shift($selected_method_of_payment) : $selected_method_of_payment;
864
+			$selected_method_of_payment = sanitize_text_field($selected_method_of_payment);
865 865
 			// store it in the session so that it's available for all subsequent requests including AJAX
866
-			$this->_save_selected_method_of_payment( $selected_method_of_payment );
866
+			$this->_save_selected_method_of_payment($selected_method_of_payment);
867 867
 		} else {
868 868
 			// or is is set in the session ?
869
-			$selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data( 'selected_method_of_payment' );
869
+			$selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data('selected_method_of_payment');
870 870
 		}
871 871
 		// do ya really really gotta have it?
872
-		if ( empty( $selected_method_of_payment ) && $required ) {
872
+		if (empty($selected_method_of_payment) && $required) {
873 873
 			EE_Error::add_error(
874 874
 				sprintf(
875
-					__( 'The selected method of payment could not be determined.%sPlease ensure that you have selected one before proceeding.%sIf you continue to experience difficulties, then refresh your browser and try again, or contact %s for assistance.', 'event_espresso' ),
875
+					__('The selected method of payment could not be determined.%sPlease ensure that you have selected one before proceeding.%sIf you continue to experience difficulties, then refresh your browser and try again, or contact %s for assistance.', 'event_espresso'),
876 876
 					'<br/>',
877 877
 					'<br/>',
878
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
878
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
879 879
 				),
880 880
 				__FILE__, __FUNCTION__, __LINE__
881 881
 			);
@@ -901,37 +901,37 @@  discard block
 block discarded – undo
901 901
 	 * @return string
902 902
 	 */
903 903
 	public function switch_payment_method() {
904
-		if ( ! $this->_verify_payment_method_is_set() ) {
904
+		if ( ! $this->_verify_payment_method_is_set()) {
905 905
 			return FALSE;
906 906
 		}
907
-		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) {
907
+		if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) {
908 908
 			EE_Error::add_success(
909 909
 				apply_filters(
910 910
 					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
911
-					sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $this->checkout->payment_method->name() )
911
+					sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name())
912 912
 				)
913 913
 			);
914 914
 		}
915 915
 		// generate billing form for selected method of payment if it hasn't been done already
916
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
917
-			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
916
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
917
+			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
918 918
 		}
919 919
 		// fill form with attendee info if applicable
920
-		if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant() ) {
921
-			$this->checkout->billing_form->populate_from_attendee( $this->checkout->transaction->primary_registration()->attendee() );
920
+		if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant()) {
921
+			$this->checkout->billing_form->populate_from_attendee($this->checkout->transaction->primary_registration()->attendee());
922 922
 		}
923 923
 		// and debug content
924
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base ) {
925
-			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings( $this->checkout->billing_form );
924
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base) {
925
+			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings($this->checkout->billing_form);
926 926
 		}
927 927
 		// get html and validation rules for form
928
-		if ( $this->checkout->billing_form instanceof EE_Form_Section_Proper ) {
929
-			$this->checkout->json_response->set_return_data( array( 'payment_method_info' => $this->checkout->billing_form->get_html() ));
928
+		if ($this->checkout->billing_form instanceof EE_Form_Section_Proper) {
929
+			$this->checkout->json_response->set_return_data(array('payment_method_info' => $this->checkout->billing_form->get_html()));
930 930
 			// localize validation rules for main form
931
-			$this->checkout->billing_form->localize_validation_rules( TRUE );
932
-			$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
931
+			$this->checkout->billing_form->localize_validation_rules(TRUE);
932
+			$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
933 933
 		} else {
934
-			$this->checkout->json_response->set_return_data( array( 'payment_method_info' => '' ));
934
+			$this->checkout->json_response->set_return_data(array('payment_method_info' => ''));
935 935
 		}
936 936
 		//prevents advancement to next step
937 937
 		$this->checkout->continue_reg = FALSE;
@@ -946,12 +946,12 @@  discard block
 block discarded – undo
946 946
 	 */
947 947
 	protected function _verify_payment_method_is_set() {
948 948
 		// generate billing form for selected method of payment if it hasn't been done already
949
-		if ( empty( $this->checkout->selected_method_of_payment )) {
949
+		if (empty($this->checkout->selected_method_of_payment)) {
950 950
 			// how have they chosen to pay?
951
-			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( TRUE );
951
+			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(TRUE);
952 952
 		}
953 953
 		// verify payment method
954
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
954
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
955 955
 			// get payment method for selected method of payment
956 956
 			$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
957 957
 		}
@@ -971,23 +971,23 @@  discard block
 block discarded – undo
971 971
 	 * @return void
972 972
 	 */
973 973
 	public function save_payer_details_via_ajax() {
974
-		if ( ! $this->_verify_payment_method_is_set() ) {
974
+		if ( ! $this->_verify_payment_method_is_set()) {
975 975
 			return;
976 976
 		}
977 977
 		// generate billing form for selected method of payment if it hasn't been done already
978
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
979
-			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
978
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
979
+			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
980 980
 		}
981 981
 		// generate primary attendee from payer info if applicable
982 982
 		if ( ! $this->checkout->transaction_has_primary_registrant()) {
983 983
 			$attendee = $this->_create_attendee_from_request_data();
984
-			if ( $attendee instanceof EE_Attendee ) {
985
-				foreach ( $this->checkout->transaction->registrations() as $registration ) {
986
-					if ( $registration->is_primary_registrant() ) {
984
+			if ($attendee instanceof EE_Attendee) {
985
+				foreach ($this->checkout->transaction->registrations() as $registration) {
986
+					if ($registration->is_primary_registrant()) {
987 987
 						$this->checkout->primary_attendee_obj = $attendee;
988
-						$registration->_add_relation_to( $attendee, 'Attendee' );
989
-						$registration->set_attendee_id( $attendee->ID() );
990
-						$registration->update_cache_after_object_save( 'Attendee', $attendee );
988
+						$registration->_add_relation_to($attendee, 'Attendee');
989
+						$registration->set_attendee_id($attendee->ID());
990
+						$registration->update_cache_after_object_save('Attendee', $attendee);
991 991
 					}
992 992
 				}
993 993
 			}
@@ -1000,56 +1000,56 @@  discard block
 block discarded – undo
1000 1000
 	 * uses info from alternate GET or POST data (such as AJAX) to create a new attendee
1001 1001
 	 * @return \EE_Attendee
1002 1002
 	 */
1003
-	protected function _create_attendee_from_request_data(){
1003
+	protected function _create_attendee_from_request_data() {
1004 1004
 		// get State ID
1005
-		$STA_ID = ! empty( $_REQUEST['state'] ) ? sanitize_text_field( $_REQUEST['state'] ) : '';
1006
-		if ( ! empty( $STA_ID )) {
1005
+		$STA_ID = ! empty($_REQUEST['state']) ? sanitize_text_field($_REQUEST['state']) : '';
1006
+		if ( ! empty($STA_ID)) {
1007 1007
 			// can we get state object from name ?
1008
-			EE_Registry::instance()->load_model( 'State' );
1009
-			$state = EEM_State::instance()->get_col( array( array( 'STA_name' => $STA_ID ), 'limit' => 1), 'STA_ID' );
1010
-			$STA_ID = is_array( $state ) && ! empty( $state ) ? reset( $state ) : $STA_ID;
1008
+			EE_Registry::instance()->load_model('State');
1009
+			$state = EEM_State::instance()->get_col(array(array('STA_name' => $STA_ID), 'limit' => 1), 'STA_ID');
1010
+			$STA_ID = is_array($state) && ! empty($state) ? reset($state) : $STA_ID;
1011 1011
 		}
1012 1012
 		// get Country ISO
1013
-		$CNT_ISO = ! empty( $_REQUEST['country'] ) ? sanitize_text_field( $_REQUEST['country'] ) : '';
1014
-		if ( ! empty( $CNT_ISO )) {
1013
+		$CNT_ISO = ! empty($_REQUEST['country']) ? sanitize_text_field($_REQUEST['country']) : '';
1014
+		if ( ! empty($CNT_ISO)) {
1015 1015
 			// can we get country object from name ?
1016
-			EE_Registry::instance()->load_model( 'Country' );
1017
-			$country = EEM_Country::instance()->get_col( array( array( 'CNT_name' => $CNT_ISO ), 'limit' => 1), 'CNT_ISO' );
1018
-			$CNT_ISO = is_array( $country ) && ! empty( $country ) ? reset( $country ) : $CNT_ISO;
1016
+			EE_Registry::instance()->load_model('Country');
1017
+			$country = EEM_Country::instance()->get_col(array(array('CNT_name' => $CNT_ISO), 'limit' => 1), 'CNT_ISO');
1018
+			$CNT_ISO = is_array($country) && ! empty($country) ? reset($country) : $CNT_ISO;
1019 1019
 		}
1020 1020
 		// grab attendee data
1021 1021
 		$attendee_data = array(
1022
-			'ATT_fname' 		=> ! empty( $_REQUEST['first_name'] ) ? sanitize_text_field( $_REQUEST['first_name'] ) : '',
1023
-			'ATT_lname' 		=> ! empty( $_REQUEST['last_name'] ) ? sanitize_text_field( $_REQUEST['last_name'] ) : '',
1024
-			'ATT_email' 		=> ! empty( $_REQUEST['email'] ) ? sanitize_email( $_REQUEST['email'] ) : '',
1025
-			'ATT_address' 		=> ! empty( $_REQUEST['address'] ) ? sanitize_text_field( $_REQUEST['address'] ) : '',
1026
-			'ATT_address2' 	=> ! empty( $_REQUEST['address2'] ) ? sanitize_text_field( $_REQUEST['address2'] ) : '',
1027
-			'ATT_city' 			=> ! empty( $_REQUEST['city'] ) ? sanitize_text_field( $_REQUEST['city'] ) : '',
1022
+			'ATT_fname' 		=> ! empty($_REQUEST['first_name']) ? sanitize_text_field($_REQUEST['first_name']) : '',
1023
+			'ATT_lname' 		=> ! empty($_REQUEST['last_name']) ? sanitize_text_field($_REQUEST['last_name']) : '',
1024
+			'ATT_email' 		=> ! empty($_REQUEST['email']) ? sanitize_email($_REQUEST['email']) : '',
1025
+			'ATT_address' 		=> ! empty($_REQUEST['address']) ? sanitize_text_field($_REQUEST['address']) : '',
1026
+			'ATT_address2' 	=> ! empty($_REQUEST['address2']) ? sanitize_text_field($_REQUEST['address2']) : '',
1027
+			'ATT_city' 			=> ! empty($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : '',
1028 1028
 			'STA_ID' 				=> $STA_ID,
1029 1029
 			'CNT_ISO' 			=> $CNT_ISO,
1030
-			'ATT_zip' 				=> ! empty( $_REQUEST['zip'] ) ? sanitize_text_field( $_REQUEST['zip'] ) : '',
1031
-			'ATT_phone' 		=> ! empty( $_REQUEST['phone'] ) ? sanitize_text_field( $_REQUEST['phone'] ) : '',
1030
+			'ATT_zip' 				=> ! empty($_REQUEST['zip']) ? sanitize_text_field($_REQUEST['zip']) : '',
1031
+			'ATT_phone' 		=> ! empty($_REQUEST['phone']) ? sanitize_text_field($_REQUEST['phone']) : '',
1032 1032
 		);
1033 1033
 		// validate the email address since it is the most important piece of info
1034
-		if ( empty( $attendee_data['ATT_email'] ) || $attendee_data['ATT_email'] != $_REQUEST['email'] ) {
1035
-			EE_Error::add_error( __( 'An invalid email address was submitted.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1034
+		if (empty($attendee_data['ATT_email']) || $attendee_data['ATT_email'] != $_REQUEST['email']) {
1035
+			EE_Error::add_error(__('An invalid email address was submitted.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1036 1036
 		}
1037 1037
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1038
-		if ( ! empty( $attendee_data['ATT_fname'] ) && ! empty( $attendee_data['ATT_lname'] ) && ! empty( $attendee_data['ATT_email'] ) ) {
1039
-			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee( array(
1038
+		if ( ! empty($attendee_data['ATT_fname']) && ! empty($attendee_data['ATT_lname']) && ! empty($attendee_data['ATT_email'])) {
1039
+			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(array(
1040 1040
 				'ATT_fname' => $attendee_data['ATT_fname'],
1041 1041
 				'ATT_lname' => $attendee_data['ATT_lname'],
1042 1042
 				'ATT_email' => $attendee_data['ATT_email']
1043 1043
 			));
1044
-			if ( $existing_attendee instanceof EE_Attendee ) {
1044
+			if ($existing_attendee instanceof EE_Attendee) {
1045 1045
 				return $existing_attendee;
1046 1046
 			}
1047 1047
 		}
1048 1048
 		// no existing attendee? kk let's create a new one
1049 1049
 		// kinda lame, but we need a first and last name to create an attendee, so use the email address if those don't exist
1050
-		$attendee_data['ATT_fname'] = ! empty( $attendee_data['ATT_fname'] ) ? $attendee_data['ATT_fname'] : $attendee_data['ATT_email'];
1051
-		$attendee_data['ATT_lname'] = ! empty( $attendee_data['ATT_lname'] ) ? $attendee_data['ATT_lname'] : $attendee_data['ATT_email'];
1052
-		return EE_Attendee::new_instance( $attendee_data );
1050
+		$attendee_data['ATT_fname'] = ! empty($attendee_data['ATT_fname']) ? $attendee_data['ATT_fname'] : $attendee_data['ATT_email'];
1051
+		$attendee_data['ATT_lname'] = ! empty($attendee_data['ATT_lname']) ? $attendee_data['ATT_lname'] : $attendee_data['ATT_email'];
1052
+		return EE_Attendee::new_instance($attendee_data);
1053 1053
 	}
1054 1054
 
1055 1055
 
@@ -1069,22 +1069,22 @@  discard block
 block discarded – undo
1069 1069
 	 */
1070 1070
 	public function process_reg_step() {
1071 1071
 		// how have they chosen to pay?
1072
-		$this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free() ? 'no_payment_required' : $this->_get_selected_method_of_payment( TRUE );
1072
+		$this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free() ? 'no_payment_required' : $this->_get_selected_method_of_payment(TRUE);
1073 1073
 		// choose your own adventure based on method_of_payment
1074
-		switch(  $this->checkout->selected_method_of_payment ) {
1074
+		switch ($this->checkout->selected_method_of_payment) {
1075 1075
 
1076 1076
 			case 'events_sold_out' :
1077 1077
 				$this->checkout->redirect = TRUE;
1078 1078
 				$this->checkout->redirect_url = $this->checkout->cancel_page_url;
1079
-				$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1079
+				$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1080 1080
 				// mark this reg step as completed
1081 1081
 				$this->set_completed();
1082 1082
 				return FALSE;
1083 1083
 				break;
1084 1084
 
1085 1085
 			case 'payments_closed' :
1086
-				if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', false ) ) {
1087
-					EE_Error::add_success( __( 'no payment required at this time.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1086
+				if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', false)) {
1087
+					EE_Error::add_success(__('no payment required at this time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1088 1088
 				}
1089 1089
 				// mark this reg step as completed
1090 1090
 				$this->set_completed();
@@ -1092,8 +1092,8 @@  discard block
 block discarded – undo
1092 1092
 				break;
1093 1093
 
1094 1094
 			case 'no_payment_required' :
1095
-				if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', false ) ) {
1096
-					EE_Error::add_success( __( 'no payment required.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1095
+				if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', false)) {
1096
+					EE_Error::add_success(__('no payment required.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1097 1097
 				}
1098 1098
 				// mark this reg step as completed
1099 1099
 				$this->set_completed();
@@ -1102,9 +1102,9 @@  discard block
 block discarded – undo
1102 1102
 
1103 1103
 			default:
1104 1104
 				$payment_successful = $this->_process_payment();
1105
-				if ( $payment_successful ) {
1105
+				if ($payment_successful) {
1106 1106
 					$this->checkout->continue_reg = true;
1107
-					$this->_maybe_set_completed( $this->checkout->payment_method );
1107
+					$this->_maybe_set_completed($this->checkout->payment_method);
1108 1108
 				} else {
1109 1109
 					$this->checkout->continue_reg = false;
1110 1110
 				}
@@ -1122,8 +1122,8 @@  discard block
 block discarded – undo
1122 1122
 	 * @param \EE_Payment_Method $payment_method
1123 1123
 	 * @return void
1124 1124
 	 */
1125
-	protected function _maybe_set_completed( EE_Payment_Method $payment_method ) {
1126
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1125
+	protected function _maybe_set_completed(EE_Payment_Method $payment_method) {
1126
+		switch ($payment_method->type_obj()->payment_occurs()) {
1127 1127
 			case EE_PMT_Base::offsite :
1128 1128
 				break;
1129 1129
 			case EE_PMT_Base::onsite :
@@ -1146,15 +1146,15 @@  discard block
 block discarded – undo
1146 1146
 	public function update_reg_step() {
1147 1147
 		$success = TRUE;
1148 1148
 		// if payment required
1149
-		if ( $this->checkout->transaction->total() > 0 ) {
1150
-			do_action ('AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', $this->checkout->transaction );
1149
+		if ($this->checkout->transaction->total() > 0) {
1150
+			do_action('AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', $this->checkout->transaction);
1151 1151
 			// attempt payment via payment method
1152 1152
 			$success = $this->process_reg_step();
1153 1153
 		}
1154
-		if ( $success && ! $this->checkout->redirect ) {
1155
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $this->checkout->transaction->ID() );
1154
+		if ($success && ! $this->checkout->redirect) {
1155
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($this->checkout->transaction->ID());
1156 1156
 			 // set return URL
1157
-			$this->checkout->redirect_url = add_query_arg( array( 'e_reg_url_link' => $this->checkout->reg_url_link ), $this->checkout->thank_you_page_url );
1157
+			$this->checkout->redirect_url = add_query_arg(array('e_reg_url_link' => $this->checkout->reg_url_link), $this->checkout->thank_you_page_url);
1158 1158
 		}
1159 1159
 		return $success;
1160 1160
 	}
@@ -1174,24 +1174,24 @@  discard block
 block discarded – undo
1174 1174
 		// clear any previous errors related to not selecting a payment method
1175 1175
 //		EE_Error::overwrite_errors();
1176 1176
 		// ya gotta make a choice man
1177
-		if ( empty( $this->checkout->selected_method_of_payment )) {
1178
-			$this->checkout->json_response->set_plz_select_method_of_payment( __( 'Please select a method of payment before proceeding.', 'event_espresso' ));
1177
+		if (empty($this->checkout->selected_method_of_payment)) {
1178
+			$this->checkout->json_response->set_plz_select_method_of_payment(__('Please select a method of payment before proceeding.', 'event_espresso'));
1179 1179
 			return FALSE;
1180 1180
 		}
1181 1181
 		// get EE_Payment_Method object
1182
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
1182
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
1183 1183
 			return FALSE;
1184 1184
 		}
1185 1185
 		// setup billing form
1186
-		if ( $this->checkout->payment_method->is_on_site() ) {
1187
-			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
1186
+		if ($this->checkout->payment_method->is_on_site()) {
1187
+			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
1188 1188
 			// bad billing form ?
1189
-			if ( ! $this->_billing_form_is_valid() ) {
1189
+			if ( ! $this->_billing_form_is_valid()) {
1190 1190
 				return FALSE;
1191 1191
 			}
1192 1192
 		}
1193 1193
 		// ensure primary registrant has been fully processed
1194
-		if ( ! $this->_setup_primary_registrant_prior_to_payment() ) {
1194
+		if ( ! $this->_setup_primary_registrant_prior_to_payment()) {
1195 1195
 			return FALSE;
1196 1196
 		}
1197 1197
 		/** @type EE_Transaction_Processor $transaction_processor */
@@ -1199,24 +1199,24 @@  discard block
 block discarded – undo
1199 1199
 		// in case a registrant leaves to an Off-Site Gateway and never returns, we want to approve any registrations for events with a default reg status of Approved
1200 1200
 		//$transaction_processor->toggle_registration_statuses_for_default_approved_events( $this->checkout->transaction, $this->checkout->reg_cache_where_params );
1201 1201
 		// attempt payment
1202
-		$payment = $this->_attempt_payment( $this->checkout->payment_method );
1202
+		$payment = $this->_attempt_payment($this->checkout->payment_method);
1203 1203
 		// process results
1204
-		$payment = $this->_validate_payment( $payment );
1205
-		$payment = $this->_post_payment_processing( $payment );
1204
+		$payment = $this->_validate_payment($payment);
1205
+		$payment = $this->_post_payment_processing($payment);
1206 1206
 		// verify payment
1207
-		if ( $payment instanceof EE_Payment ) {
1207
+		if ($payment instanceof EE_Payment) {
1208 1208
 			// store that for later
1209 1209
 			$this->checkout->payment = $payment;
1210 1210
 			/** @type EE_Transaction_Processor $transaction_processor */
1211
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1211
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1212 1212
 			// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
1213
-			$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1214
-			if ( $payment->status() == EEM_Payment::status_id_approved || $payment->status() == EEM_Payment::status_id_pending ) {
1213
+			$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1214
+			if ($payment->status() == EEM_Payment::status_id_approved || $payment->status() == EEM_Payment::status_id_pending) {
1215 1215
 				return true;
1216 1216
 			} else {
1217 1217
 				return false;
1218 1218
 			}
1219
-		} else if ( $payment === true ) {
1219
+		} else if ($payment === true) {
1220 1220
 			// please note that offline payment methods will NOT make a payment,
1221 1221
 			// but instead just mark themselves as the PMD_ID on the transaction, and return true
1222 1222
 			$this->checkout->payment = $payment;
@@ -1235,10 +1235,10 @@  discard block
 block discarded – undo
1235 1235
 	 * @return bool
1236 1236
 	 */
1237 1237
 	public function redirect_form() {
1238
-		$payment_method_billing_info = $this->_payment_method_billing_info( $this->_get_payment_method_for_selected_method_of_payment() );
1238
+		$payment_method_billing_info = $this->_payment_method_billing_info($this->_get_payment_method_for_selected_method_of_payment());
1239 1239
 		$html = $payment_method_billing_info->get_html_and_js();
1240 1240
 		$html .= $this->checkout->redirect_form;
1241
-		EE_Registry::instance()->REQ->add_output( $html );
1241
+		EE_Registry::instance()->REQ->add_output($html);
1242 1242
 		return TRUE;
1243 1243
 	}
1244 1244
 
@@ -1251,36 +1251,36 @@  discard block
 block discarded – undo
1251 1251
 	 * @return bool
1252 1252
 	 */
1253 1253
 	private function _billing_form_is_valid() {
1254
-		if ( ! $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1254
+		if ( ! $this->checkout->payment_method->type_obj()->has_billing_form()) {
1255 1255
 			return TRUE;
1256 1256
 		}
1257
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form ) {
1258
-			if ( $this->checkout->billing_form->was_submitted() ) {
1257
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form) {
1258
+			if ($this->checkout->billing_form->was_submitted()) {
1259 1259
 				$this->checkout->billing_form->receive_form_submission();
1260
-				if ( $this->checkout->billing_form->is_valid() ) {
1260
+				if ($this->checkout->billing_form->is_valid()) {
1261 1261
 					return TRUE;
1262 1262
 				}
1263 1263
 				$validation_errors = $this->checkout->billing_form->get_validation_errors_accumulated();
1264 1264
 				$error_strings = array();
1265
-				foreach( $validation_errors as $validation_error ){
1266
-					if( $validation_error instanceof EE_Validation_Error ){
1265
+				foreach ($validation_errors as $validation_error) {
1266
+					if ($validation_error instanceof EE_Validation_Error) {
1267 1267
 						$form_section = $validation_error->get_form_section();
1268
-						if( $form_section instanceof EE_Form_Input_Base ){
1268
+						if ($form_section instanceof EE_Form_Input_Base) {
1269 1269
 							$label = $form_section->html_label_text();
1270
-						}elseif( $form_section instanceof EE_Form_Section_Base ){
1270
+						}elseif ($form_section instanceof EE_Form_Section_Base) {
1271 1271
 							$label = $form_section->name();
1272
-						}else{
1273
-							$label = __( 'Validation Error', 'event_espresso' );
1272
+						} else {
1273
+							$label = __('Validation Error', 'event_espresso');
1274 1274
 						}
1275
-						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage() );
1275
+						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage());
1276 1276
 					}
1277 1277
 				}
1278
-				EE_Error::add_error( sprintf( __( 'One or more billing form inputs are invalid and require correction before proceeding. %1$s %2$s', 'event_espresso' ), '<br/>', implode( '<br/>', $error_strings )  ), __FILE__, __FUNCTION__, __LINE__ );
1278
+				EE_Error::add_error(sprintf(__('One or more billing form inputs are invalid and require correction before proceeding. %1$s %2$s', 'event_espresso'), '<br/>', implode('<br/>', $error_strings)), __FILE__, __FUNCTION__, __LINE__);
1279 1279
 			} else {
1280
-				EE_Error::add_error( __( 'The billing form was not submitted or something prevented it\'s submission.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1280
+				EE_Error::add_error(__('The billing form was not submitted or something prevented it\'s submission.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1281 1281
 			}
1282 1282
 		} else {
1283
-			EE_Error::add_error( __( 'The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1283
+			EE_Error::add_error(__('The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1284 1284
 		}
1285 1285
 		return FALSE;
1286 1286
 	}
@@ -1298,9 +1298,9 @@  discard block
 block discarded – undo
1298 1298
 	 */
1299 1299
 		private function _setup_primary_registrant_prior_to_payment() {
1300 1300
 			// check if transaction has a primary registrant and that it has a related Attendee object
1301
-			if ( ! $this->checkout->transaction_has_primary_registrant() ) {
1301
+			if ( ! $this->checkout->transaction_has_primary_registrant()) {
1302 1302
 				// need to at least gather some primary registrant data before attempting payment
1303
-				if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && ! $this->_capture_primary_registration_data_from_billing_form() ) {
1303
+				if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && ! $this->_capture_primary_registration_data_from_billing_form()) {
1304 1304
 					return FALSE;
1305 1305
 				}
1306 1306
 			}
@@ -1308,13 +1308,13 @@  discard block
 block discarded – undo
1308 1308
 			// grab the primary_registration object
1309 1309
 			$primary_registration = $this->checkout->transaction->primary_registration();
1310 1310
 			/** @type EE_Transaction_Processor $transaction_processor */
1311
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1311
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1312 1312
 			// at this point we'll consider a TXN to not have been failed
1313
-			$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1313
+			$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1314 1314
 			// save the TXN ( which clears cached copy of primary_registration)
1315 1315
 			$this->checkout->transaction->save();
1316 1316
 			// grab TXN ID and save it to the primary_registration
1317
-			$primary_registration->set_transaction_id( $this->checkout->transaction->ID() );
1317
+			$primary_registration->set_transaction_id($this->checkout->transaction->ID());
1318 1318
 			// save what we have so far
1319 1319
 			$primary_registration->save();
1320 1320
 			return TRUE;
@@ -1331,41 +1331,41 @@  discard block
 block discarded – undo
1331 1331
 		private function _capture_primary_registration_data_from_billing_form() {
1332 1332
 			// convert billing form data into an attendee
1333 1333
 			$this->checkout->primary_attendee_obj = $this->checkout->billing_form->create_attendee_from_billing_form_data();
1334
-			if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee ) {
1334
+			if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee) {
1335 1335
 				EE_Error::add_error(
1336 1336
 					sprintf(
1337
-						__( 'The billing form details could not be used for attendee details due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1337
+						__('The billing form details could not be used for attendee details due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1338 1338
 						'<br/>',
1339
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1339
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1340 1340
 					), __FILE__, __FUNCTION__, __LINE__
1341 1341
 				);
1342 1342
 				return FALSE;
1343 1343
 			}
1344 1344
 			$primary_registration = $this->checkout->transaction->primary_registration();
1345
-			if ( ! $primary_registration instanceof EE_Registration ) {
1345
+			if ( ! $primary_registration instanceof EE_Registration) {
1346 1346
 				EE_Error::add_error(
1347 1347
 					sprintf(
1348
-						__( 'The primary registrant for this transaction could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1348
+						__('The primary registrant for this transaction could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1349 1349
 						'<br/>',
1350
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1350
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1351 1351
 					), __FILE__, __FUNCTION__, __LINE__
1352 1352
 				);
1353 1353
 				return FALSE;
1354 1354
 			}
1355
-			if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' ) instanceof EE_Attendee ) {
1355
+			if ( ! $primary_registration->_add_relation_to($this->checkout->primary_attendee_obj, 'Attendee') instanceof EE_Attendee) {
1356 1356
 				EE_Error::add_error(
1357 1357
 					sprintf(
1358
-						__( 'The primary registrant could not be associated with this transaction due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1358
+						__('The primary registrant could not be associated with this transaction due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1359 1359
 						'<br/>',
1360
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1360
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1361 1361
 					), __FILE__, __FUNCTION__, __LINE__
1362 1362
 				);
1363 1363
 				return FALSE;
1364 1364
 			}
1365 1365
 			/** @type EE_Registration_Processor $registration_processor */
1366
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1366
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1367 1367
 			// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
1368
-			$registration_processor->toggle_incomplete_registration_status_to_default( $primary_registration );
1368
+			$registration_processor->toggle_incomplete_registration_status_to_default($primary_registration);
1369 1369
 
1370 1370
 			return TRUE;
1371 1371
 		}
@@ -1381,35 +1381,35 @@  discard block
 block discarded – undo
1381 1381
 	 */
1382 1382
 		private function _get_payment_method_for_selected_method_of_payment() {
1383 1383
 			// get EE_Payment_Method object
1384
-			if ( isset( $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ] )) {
1385
-				$payment_method = $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ];
1384
+			if (isset($this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment])) {
1385
+				$payment_method = $this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment];
1386 1386
 			} else {
1387 1387
 				// load EEM_Payment_Method
1388
-				EE_Registry::instance()->load_model( 'Payment_Method' );
1388
+				EE_Registry::instance()->load_model('Payment_Method');
1389 1389
 				/** @type EEM_Payment_Method $EEM_Payment_Method */
1390 1390
 				$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
1391
-				$payment_method = $EEM_Payment_Method->get_one_by_slug( $this->checkout->selected_method_of_payment );
1391
+				$payment_method = $EEM_Payment_Method->get_one_by_slug($this->checkout->selected_method_of_payment);
1392 1392
 			}
1393 1393
 			// verify $payment_method
1394
-			if ( ! $payment_method instanceof EE_Payment_Method ) {
1394
+			if ( ! $payment_method instanceof EE_Payment_Method) {
1395 1395
 				// not a payment
1396 1396
 				EE_Error::add_error(
1397 1397
 					sprintf(
1398
-						__( 'The selected method of payment could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1398
+						__('The selected method of payment could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1399 1399
 						'<br/>',
1400
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1400
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1401 1401
 					), __FILE__, __FUNCTION__, __LINE__
1402 1402
 				);
1403 1403
 				return NULL;
1404 1404
 			}
1405 1405
 			// and verify it has a valid Payment_Method Type object
1406
-			if ( ! $payment_method->type_obj() instanceof EE_PMT_Base ) {
1406
+			if ( ! $payment_method->type_obj() instanceof EE_PMT_Base) {
1407 1407
 				// not a payment
1408 1408
 				EE_Error::add_error(
1409 1409
 					sprintf(
1410
-						__( 'A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1410
+						__('A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1411 1411
 						'<br/>',
1412
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1412
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1413 1413
 					), __FILE__, __FUNCTION__, __LINE__
1414 1414
 				);
1415 1415
 				return NULL;
@@ -1428,30 +1428,30 @@  discard block
 block discarded – undo
1428 1428
 	 * 	@type 	EE_Payment_Method $payment_method
1429 1429
 	 * 	@return 	mixed	EE_Payment | boolean
1430 1430
 	 */
1431
-	private function _attempt_payment( EE_Payment_Method $payment_method ) {
1432
-		$payment =NULL;
1431
+	private function _attempt_payment(EE_Payment_Method $payment_method) {
1432
+		$payment = NULL;
1433 1433
 		$this->checkout->transaction->save();
1434
-		$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1435
-		if ( ! $payment_processor instanceof EE_Payment_Processor ) {
1434
+		$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1435
+		if ( ! $payment_processor instanceof EE_Payment_Processor) {
1436 1436
 			return FALSE;
1437 1437
 		}
1438 1438
 		try {
1439
-			$payment_processor->set_revisit( $this->checkout->revisit );
1439
+			$payment_processor->set_revisit($this->checkout->revisit);
1440 1440
 			// generate payment object
1441 1441
 			$payment = $payment_processor->process_payment(
1442 1442
 				$payment_method,
1443 1443
 				$this->checkout->transaction,
1444 1444
 				$this->checkout->amount_owing,
1445 1445
 				$this->checkout->billing_form,
1446
-				$this->_get_return_url( $payment_method ),
1446
+				$this->_get_return_url($payment_method),
1447 1447
 				'CART',
1448 1448
 				$this->checkout->admin_request,
1449 1449
 				TRUE,
1450 1450
 				$this->reg_step_url()
1451 1451
 			);
1452 1452
 
1453
-		} catch( Exception $e ) {
1454
-			$this->_handle_payment_processor_exception( $e );
1453
+		} catch (Exception $e) {
1454
+			$this->_handle_payment_processor_exception($e);
1455 1455
 		}
1456 1456
 		return $payment;
1457 1457
 	}
@@ -1465,12 +1465,12 @@  discard block
 block discarded – undo
1465 1465
 	 * @param \Exception $e
1466 1466
 	 * @return void
1467 1467
 	 */
1468
-	protected function _handle_payment_processor_exception( Exception $e ) {
1468
+	protected function _handle_payment_processor_exception(Exception $e) {
1469 1469
 		EE_Error::add_error(
1470 1470
 			sprintf(
1471
-				__( 'The payment could not br processed due to a technical issue.%1$sPlease try again or contact %2$s for assistance.||The following Exception was thrown in %4$s on line %5$s:%1$s%3$s', 'event_espresso' ),
1471
+				__('The payment could not br processed due to a technical issue.%1$sPlease try again or contact %2$s for assistance.||The following Exception was thrown in %4$s on line %5$s:%1$s%3$s', 'event_espresso'),
1472 1472
 				'<br/>',
1473
-				EE_Registry::instance()->CFG->organization->get_pretty( 'email' ),
1473
+				EE_Registry::instance()->CFG->organization->get_pretty('email'),
1474 1474
 				$e->getMessage(),
1475 1475
 				$e->getFile(),
1476 1476
 				$e->getLine()
@@ -1487,9 +1487,9 @@  discard block
 block discarded – undo
1487 1487
 	 * @param \EE_Payment_Method $payment_method
1488 1488
 	 * @return string
1489 1489
 	 */
1490
-	protected function _get_return_url( EE_Payment_Method $payment_method ) {
1490
+	protected function _get_return_url(EE_Payment_Method $payment_method) {
1491 1491
 		$return_url = '';
1492
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1492
+		switch ($payment_method->type_obj()->payment_occurs()) {
1493 1493
 
1494 1494
 			case EE_PMT_Base::offsite :
1495 1495
 				$return_url = add_query_arg(
@@ -1520,18 +1520,18 @@  discard block
 block discarded – undo
1520 1520
 	 * @param EE_Payment $payment
1521 1521
 	 * @return EE_Payment | FALSE
1522 1522
 	 */
1523
-	private function _validate_payment( $payment = NULL ) {
1524
-		if (  $this->checkout->payment_method->is_off_line() ) {
1523
+	private function _validate_payment($payment = NULL) {
1524
+		if ($this->checkout->payment_method->is_off_line()) {
1525 1525
 			return TRUE;
1526 1526
 		}
1527 1527
 		// verify payment object
1528
-		if ( ! $payment instanceof EE_Payment ) {
1528
+		if ( ! $payment instanceof EE_Payment) {
1529 1529
 			// not a payment
1530 1530
 			EE_Error::add_error(
1531 1531
 				sprintf(
1532
-					__( 'A valid payment was not generated due to a technical issue.%1$sPlease try again or contact %2$s for assistance.', 'event_espresso' ),
1532
+					__('A valid payment was not generated due to a technical issue.%1$sPlease try again or contact %2$s for assistance.', 'event_espresso'),
1533 1533
 					'<br/>',
1534
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1534
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1535 1535
 				), __FILE__, __FUNCTION__, __LINE__
1536 1536
 			);
1537 1537
 			return FALSE;
@@ -1548,23 +1548,23 @@  discard block
 block discarded – undo
1548 1548
 	 * @param EE_Payment $payment
1549 1549
 	 * @return bool
1550 1550
 	 */
1551
-	private function _post_payment_processing( $payment = NULL ) {
1551
+	private function _post_payment_processing($payment = NULL) {
1552 1552
 		// On-Site payment?
1553
-		if ( $this->checkout->payment_method->is_on_site() ) {
1554
-			if ( ! $this->_process_payment_status( $payment, EE_PMT_Base::onsite )) {
1553
+		if ($this->checkout->payment_method->is_on_site()) {
1554
+			if ( ! $this->_process_payment_status($payment, EE_PMT_Base::onsite)) {
1555 1555
 				//$this->_setup_redirect_for_next_step();
1556 1556
 				$this->checkout->continue_reg = false;
1557 1557
 			}
1558 1558
 			// Off-Site payment?
1559
-		} else if ( $this->checkout->payment_method->is_off_site() ) {
1559
+		} else if ($this->checkout->payment_method->is_off_site()) {
1560 1560
 			// if a payment object was made and it specifies a redirect url, then we'll setup that redirect info
1561
-			if ( $payment instanceof EE_Payment && $payment->redirect_url() ){
1562
-				do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()' );
1561
+			if ($payment instanceof EE_Payment && $payment->redirect_url()) {
1562
+				do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()');
1563 1563
 				$this->checkout->redirect = TRUE;
1564 1564
 				$this->checkout->redirect_form = $payment->redirect_form();
1565
-				$this->checkout->redirect_url = $this->reg_step_url( 'redirect_form' );
1565
+				$this->checkout->redirect_url = $this->reg_step_url('redirect_form');
1566 1566
 				// set JSON response
1567
-				$this->checkout->json_response->set_redirect_form( $this->checkout->redirect_form );
1567
+				$this->checkout->json_response->set_redirect_form($this->checkout->redirect_form);
1568 1568
 				// set cron job for finalizing the TXN
1569 1569
 				// in case the user does not return from the off-site gateway
1570 1570
 				EE_Cron_Tasks::schedule_finalize_abandoned_transactions_check(
@@ -1572,21 +1572,21 @@  discard block
 block discarded – undo
1572 1572
 					$this->checkout->transaction->ID()
1573 1573
 				);
1574 1574
 				// and lastly, let's bump the payment status to pending
1575
-				$payment->set_status( EEM_Payment::status_id_pending );
1575
+				$payment->set_status(EEM_Payment::status_id_pending);
1576 1576
 				$payment->save();
1577 1577
 			} else {
1578 1578
 				// not a payment
1579 1579
 				$this->checkout->continue_reg = false;
1580 1580
 				EE_Error::add_error(
1581 1581
 					sprintf(
1582
-						__( 'It appears the Off Site Payment Method was not configured properly.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1582
+						__('It appears the Off Site Payment Method was not configured properly.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1583 1583
 						'<br/>',
1584
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1584
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1585 1585
 					), __FILE__, __FUNCTION__, __LINE__
1586 1586
 				);
1587 1587
 			}
1588 1588
 			// Off-Line payment?
1589
-		} else if ( $payment === TRUE ) {
1589
+		} else if ($payment === TRUE) {
1590 1590
 			//$this->_setup_redirect_for_next_step();
1591 1591
 			return TRUE;
1592 1592
 		} else {
@@ -1622,65 +1622,65 @@  discard block
 block discarded – undo
1622 1622
 	 * @return bool
1623 1623
 	 * @throws \EE_Error
1624 1624
 	 */
1625
-	private function _process_payment_status( $payment, $payment_occurs = EE_PMT_Base::offline ) {
1625
+	private function _process_payment_status($payment, $payment_occurs = EE_PMT_Base::offline) {
1626 1626
 		// off-line payment? carry on
1627
-		if ( $payment_occurs == EE_PMT_Base::offline ) {
1627
+		if ($payment_occurs == EE_PMT_Base::offline) {
1628 1628
 			return true;
1629 1629
 		}
1630 1630
 		// verify payment validity
1631
-		if ( $payment instanceof EE_Payment ) {
1632
-			do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()' );
1631
+		if ($payment instanceof EE_Payment) {
1632
+			do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()');
1633 1633
 			$msg = $payment->gateway_response();
1634 1634
 			// check results
1635
-			switch ( $payment->status() ) {
1635
+			switch ($payment->status()) {
1636 1636
 
1637 1637
 				// good payment
1638 1638
 				case EEM_Payment::status_id_approved :
1639
-					EE_Error::add_success( __( 'Your payment was processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1639
+					EE_Error::add_success(__('Your payment was processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1640 1640
 					return TRUE;
1641 1641
 					break;
1642 1642
 
1643 1643
 				// slow payment
1644 1644
 				case EEM_Payment::status_id_pending :
1645
-					if ( empty( $msg )) {
1646
-						$msg = __( 'Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', 'event_espresso' );
1645
+					if (empty($msg)) {
1646
+						$msg = __('Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', 'event_espresso');
1647 1647
 					}
1648
-					EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ );
1648
+					EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__);
1649 1649
 					return TRUE;
1650 1650
 					break;
1651 1651
 
1652 1652
 				// don't wanna payment
1653 1653
 				case EEM_Payment::status_id_cancelled :
1654
-					if ( empty( $msg )) {
1654
+					if (empty($msg)) {
1655 1655
 						$msg = _n(
1656 1656
 							'Payment cancelled. Please try again.',
1657 1657
 							'Payment cancelled. Please try again or select another method of payment.',
1658
-							count( $this->checkout->available_payment_methods ),
1658
+							count($this->checkout->available_payment_methods),
1659 1659
 							'event_espresso'
1660 1660
 						);
1661 1661
 					}
1662
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
1662
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
1663 1663
 					return FALSE;
1664 1664
 					break;
1665 1665
 
1666 1666
 				// not enough payment
1667 1667
 				case EEM_Payment::status_id_declined :
1668
-					if ( empty( $msg )) {
1668
+					if (empty($msg)) {
1669 1669
 						$msg = _n(
1670 1670
 							'We\'re sorry but your payment was declined. Please try again.',
1671 1671
 							'We\'re sorry but your payment was declined. Please try again or select another method of payment.',
1672
-							count( $this->checkout->available_payment_methods ),
1672
+							count($this->checkout->available_payment_methods),
1673 1673
 							'event_espresso'
1674 1674
 						);
1675 1675
 					}
1676
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
1676
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
1677 1677
 					return FALSE;
1678 1678
 					break;
1679 1679
 
1680 1680
 				// bad payment
1681 1681
 				case EEM_Payment::status_id_failed :
1682
-					if ( ! empty( $msg ) ) {
1683
-						EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1682
+					if ( ! empty($msg)) {
1683
+						EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1684 1684
 						return false;
1685 1685
 					}
1686 1686
 					// default to error below
@@ -1690,14 +1690,14 @@  discard block
 block discarded – undo
1690 1690
 		}
1691 1691
 		// off-site payment gateway responses are too unreliable, so let's just assume that
1692 1692
 		// the payment processing is just running slower than the registrant's request
1693
-		if ( $payment_occurs == EE_PMT_Base::offsite ) {
1693
+		if ($payment_occurs == EE_PMT_Base::offsite) {
1694 1694
 			return true;
1695 1695
 		}
1696 1696
 		EE_Error::add_error(
1697 1697
 				sprintf(
1698
-					__( 'Your payment could not be processed successfully due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1698
+					__('Your payment could not be processed successfully due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1699 1699
 					'<br/>',
1700
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1700
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1701 1701
 				),
1702 1702
 				__FILE__, __FUNCTION__, __LINE__
1703 1703
 			);
@@ -1728,13 +1728,13 @@  discard block
 block discarded – undo
1728 1728
 	public function process_gateway_response() {
1729 1729
 		$payment = null;
1730 1730
 		// how have they chosen to pay?
1731
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
1731
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
1732 1732
 		// get EE_Payment_Method object
1733
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
1733
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
1734 1734
 			$this->checkout->continue_reg = false;
1735 1735
 			return false;
1736 1736
 		}
1737
-		if ( ! $this->checkout->payment_method->is_off_site() ) {
1737
+		if ( ! $this->checkout->payment_method->is_off_site()) {
1738 1738
 			return false;
1739 1739
 		}
1740 1740
 		$this->_validate_offsite_return();
@@ -1748,23 +1748,23 @@  discard block
 block discarded – undo
1748 1748
 		//	true
1749 1749
 		//);
1750 1750
 		// verify TXN
1751
-		if ( $this->checkout->transaction instanceof EE_Transaction ) {
1751
+		if ($this->checkout->transaction instanceof EE_Transaction) {
1752 1752
 			$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
1753
-			if ( ! $gateway instanceof EE_Offsite_Gateway ) {
1753
+			if ( ! $gateway instanceof EE_Offsite_Gateway) {
1754 1754
 				$this->checkout->continue_reg = false;
1755 1755
 				return false;
1756 1756
 			}
1757
-			$payment = $this->_process_off_site_payment( $gateway );
1758
-			$payment = $this->_process_cancelled_payments( $payment );
1759
-			$payment = $this->_validate_payment( $payment );
1757
+			$payment = $this->_process_off_site_payment($gateway);
1758
+			$payment = $this->_process_cancelled_payments($payment);
1759
+			$payment = $this->_validate_payment($payment);
1760 1760
 			// if payment was not declined by the payment gateway or cancelled by the registrant
1761
-			if ( $this->_process_payment_status( $payment, EE_PMT_Base::offsite ) ) {
1761
+			if ($this->_process_payment_status($payment, EE_PMT_Base::offsite)) {
1762 1762
 				//$this->_setup_redirect_for_next_step();
1763 1763
 				// store that for later
1764 1764
 				$this->checkout->payment = $payment;
1765 1765
 				// mark this reg step as completed, as long as gateway doesn't use a separate IPN request,
1766 1766
 				// because we will complete this step during the IPN processing then
1767
-				if ( $gateway instanceof EE_Offsite_Gateway && ! $this->handle_IPN_in_this_request() ) {
1767
+				if ($gateway instanceof EE_Offsite_Gateway && ! $this->handle_IPN_in_this_request()) {
1768 1768
 					$this->set_completed();
1769 1769
 				}
1770 1770
 				return true;
@@ -1787,19 +1787,19 @@  discard block
 block discarded – undo
1787 1787
 	 * @return bool
1788 1788
 	 */
1789 1789
 	private function _validate_offsite_return() {
1790
-		$TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 );
1791
-		if ( $TXN_ID != $this->checkout->transaction->ID() ) {
1790
+		$TXN_ID = (int) EE_Registry::instance()->REQ->get('spco_txn', 0);
1791
+		if ($TXN_ID != $this->checkout->transaction->ID()) {
1792 1792
 			// Houston... we might have a problem
1793 1793
 			$invalid_TXN = false;
1794 1794
 			// first gather some info
1795
-			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1795
+			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1796 1796
 			$primary_registrant = $valid_TXN instanceof EE_Transaction ? $valid_TXN->primary_registration() : null;
1797 1797
 			// let's start by retrieving the cart for this TXN
1798
-			$cart = EE_Cart::get_cart_from_txn( $this->checkout->transaction );
1799
-			if ( $cart instanceof EE_Cart ) {
1798
+			$cart = EE_Cart::get_cart_from_txn($this->checkout->transaction);
1799
+			if ($cart instanceof EE_Cart) {
1800 1800
 				// verify that the current cart has tickets
1801 1801
 				$tickets = $cart->get_tickets();
1802
-				if ( empty( $tickets ) ) {
1802
+				if (empty($tickets)) {
1803 1803
 					$invalid_TXN = true;
1804 1804
 				}
1805 1805
 			} else {
@@ -1807,39 +1807,39 @@  discard block
 block discarded – undo
1807 1807
 			}
1808 1808
 			$valid_TXN_SID = $primary_registrant instanceof EE_Registration ? $primary_registrant->session_ID() : null;
1809 1809
 			// validate current Session ID and compare against valid TXN session ID
1810
-			if ( EE_Session::instance()->id() === null ) {
1810
+			if (EE_Session::instance()->id() === null) {
1811 1811
 				$invalid_TXN = true;
1812
-			} else if ( EE_Session::instance()->id() === $valid_TXN_SID ) {
1812
+			} else if (EE_Session::instance()->id() === $valid_TXN_SID) {
1813 1813
 				// WARNING !!!
1814 1814
 				// this could be PayPal sending back duplicate requests (ya they do that)
1815 1815
 				// or it **could** mean someone is simply registering AGAIN after having just done so
1816 1816
 				// so now we need to determine if this current TXN looks valid or not
1817 1817
 				/** @type EE_Transaction_Processor $transaction_processor */
1818
-				$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1818
+				$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1819 1819
 				// has this step even been started ?
1820
-				if ( $transaction_processor->reg_step_completed( $this->checkout->transaction, $this->slug() === false )
1820
+				if ($transaction_processor->reg_step_completed($this->checkout->transaction, $this->slug() === false)
1821 1821
 				) {
1822 1822
 					// really? you're half way through this reg step, but you never started it ?
1823 1823
 					$invalid_TXN = true;
1824 1824
 				}
1825 1825
 			}
1826
-			if ( $invalid_TXN ) {
1826
+			if ($invalid_TXN) {
1827 1827
 				// is the valid TXN completed ?
1828
-				if ( $valid_TXN instanceof EE_Transaction ) {
1828
+				if ($valid_TXN instanceof EE_Transaction) {
1829 1829
 					/** @type EE_Transaction_Processor $transaction_processor */
1830
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1830
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1831 1831
 					// has this step even been started ?
1832
-					$reg_step_completed = $transaction_processor->reg_step_completed( $valid_TXN, $this->slug() );
1833
-					if ( $reg_step_completed !== false && $reg_step_completed !== true ) {
1832
+					$reg_step_completed = $transaction_processor->reg_step_completed($valid_TXN, $this->slug());
1833
+					if ($reg_step_completed !== false && $reg_step_completed !== true) {
1834 1834
 						// so it **looks** like this is a double request from PayPal
1835 1835
 						// so let's try to pick up where we left off
1836 1836
 						$this->checkout->transaction = $valid_TXN;
1837
-						$this->checkout->refresh_all_entities( true );
1837
+						$this->checkout->refresh_all_entities(true);
1838 1838
 						return;
1839 1839
 					}
1840 1840
 				}
1841 1841
 				// you appear to be lost?
1842
-				$this->_redirect_wayward_request( $primary_registrant );
1842
+				$this->_redirect_wayward_request($primary_registrant);
1843 1843
 			}
1844 1844
 		}
1845 1845
 	}
@@ -1853,16 +1853,16 @@  discard block
 block discarded – undo
1853 1853
 	 * @param \EE_Registration $primary_registrant
1854 1854
 	 * @return bool
1855 1855
 	 */
1856
-	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
1857
-		if ( ! $primary_registrant instanceof EE_Registration ) {
1856
+	private function _redirect_wayward_request(EE_Registration $primary_registrant) {
1857
+		if ( ! $primary_registrant instanceof EE_Registration) {
1858 1858
 			// try redirecting based on the current TXN
1859 1859
 			$primary_registrant = $this->checkout->transaction instanceof EE_Transaction ? $this->checkout->transaction->primary_registration() : null;
1860
-			if ( ! $primary_registrant instanceof EE_Registration ) {
1860
+			if ( ! $primary_registrant instanceof EE_Registration) {
1861 1861
 				EE_Error::add_error(
1862 1862
 					sprintf(
1863
-						__( 'Invalid information was received from the Off-Site Payment Processor and your Transaction details could not be retrieved from the database.%1$sPlease try again or contact %2$s for assistance.', 'event_espresso' ),
1863
+						__('Invalid information was received from the Off-Site Payment Processor and your Transaction details could not be retrieved from the database.%1$sPlease try again or contact %2$s for assistance.', 'event_espresso'),
1864 1864
 						'<br/>',
1865
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1865
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1866 1866
 					),
1867 1867
 					__FILE__, __FUNCTION__, __LINE__
1868 1868
 				);
@@ -1890,17 +1890,17 @@  discard block
 block discarded – undo
1890 1890
 	 * @param \EE_Offsite_Gateway $gateway
1891 1891
 	 * @return \EE_Payment
1892 1892
 	 */
1893
-	private function _process_off_site_payment( EE_Offsite_Gateway $gateway ) {
1893
+	private function _process_off_site_payment(EE_Offsite_Gateway $gateway) {
1894 1894
 		try {
1895 1895
 			$request_data = \EE_Registry::instance()->REQ->params();
1896 1896
 			// if gateway uses_separate_IPN_request, then we don't have to process the IPN manually
1897 1897
 			$this->set_handle_IPN_in_this_request(
1898
-				$gateway->handle_IPN_in_this_request( $request_data, false )
1898
+				$gateway->handle_IPN_in_this_request($request_data, false)
1899 1899
 			);
1900
-			if ( $this->handle_IPN_in_this_request() ) {
1900
+			if ($this->handle_IPN_in_this_request()) {
1901 1901
 				// get payment details and process results
1902 1902
 				/** @type EE_Payment_Processor $payment_processor */
1903
-				$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1903
+				$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1904 1904
 				$payment = $payment_processor->process_ipn(
1905 1905
 					$request_data,
1906 1906
 					$this->checkout->transaction,
@@ -1913,14 +1913,14 @@  discard block
 block discarded – undo
1913 1913
 				$payment = $this->checkout->transaction->last_payment();
1914 1914
 				//$payment_source = 'last_payment';
1915 1915
 			}
1916
-		} catch ( Exception $e ) {
1916
+		} catch (Exception $e) {
1917 1917
 			// let's just eat the exception and try to move on using any previously set payment info
1918 1918
 			$payment = $this->checkout->transaction->last_payment();
1919 1919
 			//$payment_source = 'last_payment after Exception';
1920 1920
 			// but if we STILL don't have a payment object
1921
-			if ( ! $payment instanceof EE_Payment ) {
1921
+			if ( ! $payment instanceof EE_Payment) {
1922 1922
 				// then we'll object ! ( not object like a thing... but object like what a lawyer says ! )
1923
-				$this->_handle_payment_processor_exception( $e );
1923
+				$this->_handle_payment_processor_exception($e);
1924 1924
 			}
1925 1925
 		}
1926 1926
 		// DEBUG LOG
@@ -1944,13 +1944,13 @@  discard block
 block discarded – undo
1944 1944
 	 * @param EE_Payment $payment
1945 1945
 	 * @return EE_Payment | FALSE
1946 1946
 	 */
1947
-	private function _process_cancelled_payments( $payment = NULL ) {
1947
+	private function _process_cancelled_payments($payment = NULL) {
1948 1948
 		if (
1949
-			isset( $_REQUEST[ 'ee_cancel_payment' ] )
1949
+			isset($_REQUEST['ee_cancel_payment'])
1950 1950
 			&& $payment instanceof EE_Payment
1951 1951
 			&& $payment->status() == EEM_Payment::status_id_failed
1952 1952
 		) {
1953
-			$payment->set_status( EEM_Payment::status_id_cancelled );
1953
+			$payment->set_status(EEM_Payment::status_id_cancelled);
1954 1954
 		}
1955 1955
 		return $payment;
1956 1956
 	}
@@ -1967,23 +1967,23 @@  discard block
 block discarded – undo
1967 1967
 	public function get_transaction_details_for_gateways() {
1968 1968
 		$txn_details = array();
1969 1969
 		// ya gotta make a choice man
1970
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
1970
+		if (empty($this->checkout->selected_method_of_payment)) {
1971 1971
 			$txn_details = array(
1972
-				'error' => __( 'Please select a method of payment before proceeding.', 'event_espresso' )
1972
+				'error' => __('Please select a method of payment before proceeding.', 'event_espresso')
1973 1973
 			);
1974 1974
 		}
1975 1975
 		// get EE_Payment_Method object
1976 1976
 		if (
1977
-			empty( $txn_details ) &&
1977
+			empty($txn_details) &&
1978 1978
 			! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()
1979 1979
 		) {
1980 1980
 			$txn_details = array(
1981 1981
 				'selected_method_of_payment' => $this->checkout->selected_method_of_payment,
1982
-				'error' => __( 'A valid Payment Method could not be determined.', 'event_espresso' )
1982
+				'error' => __('A valid Payment Method could not be determined.', 'event_espresso')
1983 1983
 			);
1984 1984
 		}
1985
-		if ( empty( $txn_details ) && $this->checkout->transaction instanceof EE_Transaction ) {
1986
-			$return_url = $this->_get_return_url( $this->checkout->payment_method );
1985
+		if (empty($txn_details) && $this->checkout->transaction instanceof EE_Transaction) {
1986
+			$return_url = $this->_get_return_url($this->checkout->payment_method);
1987 1987
 			$txn_details = array(
1988 1988
 				'TXN_ID'        			=> $this->checkout->transaction->ID(),
1989 1989
 				'TXN_timestamp' 	=> $this->checkout->transaction->datetime(),
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
 				'PMD_ID'        			=> $this->checkout->transaction->payment_method_ID(),
1995 1995
 				'payment_amount' => $this->checkout->amount_owing,
1996 1996
 				'return_url' 				=> $return_url,
1997
-				'cancel_url' 				=> add_query_arg( array( 'ee_cancel_payment' => true ), $return_url ),
1997
+				'cancel_url' 				=> add_query_arg(array('ee_cancel_payment' => true), $return_url),
1998 1998
 				'notify_url' 				=> EE_Config::instance()->core->txn_page_url(
1999 1999
 					array(
2000 2000
 						'e_reg_url_link'    			=> $this->checkout->transaction->primary_registration()->reg_url_link(),
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 				)
2004 2004
 			);
2005 2005
 		}
2006
-		echo json_encode( $txn_details );
2006
+		echo json_encode($txn_details);
2007 2007
 		exit();
2008 2008
 	}
2009 2009
 
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_Reg_Step_Payment_Options
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage 	core
10
- * @author 				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_Reg_Step_Payment_Options
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage 	core
10
+  * @author 				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_SPCO_Reg_Step_Payment_Options extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
@@ -764,13 +764,13 @@  discard block
 block discarded – undo
764 764
 			return FALSE;
765 765
 		}
766 766
 		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) {
767
-            EE_Error::add_success(
768
-                apply_filters(
769
-                    'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
770
-                    sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name())
771
-                )
772
-            );
773
-        }
767
+			EE_Error::add_success(
768
+				apply_filters(
769
+					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
770
+					sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name())
771
+				)
772
+			);
773
+		}
774 774
 		// now generate billing form for selected method of payment
775 775
 		$payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
776 776
 		// fill form with attendee info if applicable
@@ -802,14 +802,14 @@  discard block
 block discarded – undo
802 802
 		$billing_form = $payment_method->type_obj()->billing_form( $this->checkout->transaction, array( 'amount_owing' => $this->checkout->amount_owing ) );
803 803
 		if ( $billing_form instanceof EE_Billing_Info_Form ) {
804 804
 			if ( EE_Registry::instance()->REQ->is_set( 'payment_method' )) {
805
-                if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) {
806
-                    EE_Error::add_success(
807
-                        apply_filters(
808
-                            'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
809
-                            sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() )
810
-                        )
811
-                    );
812
-                }
805
+				if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) {
806
+					EE_Error::add_success(
807
+						apply_filters(
808
+							'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
809
+							sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() )
810
+						)
811
+					);
812
+				}
813 813
 			}
814 814
 			return apply_filters(
815 815
 				'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form',
Please login to merge, or discard this patch.
Doc Comments   +13 added lines, -11 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
 
111 111
 	/**
112
-	 * @return null
112
+	 * @return EE_Line_Item_Display
113 113
 	 */
114 114
 	public function line_item_display() {
115 115
 		return $this->line_item_display;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 
120 120
 	/**
121
-	 * @param null $line_item_display
121
+	 * @param EE_Line_Item_Display $line_item_display
122 122
 	 */
123 123
 	public function set_line_item_display( $line_item_display ) {
124 124
 		$this->line_item_display = $line_item_display;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
 
206 206
 	/**
207
-	 * @return bool
207
+	 * @return EE_Form_Section_Proper
208 208
 	 */
209 209
 	public function generate_reg_form() {
210 210
 		EE_Registry::instance()->load_helper( 'HTML' );
@@ -561,6 +561,7 @@  discard block
 block discarded – undo
561 561
 	 *    _apply_registration_payments_to_amount_owing
562 562
 	 *
563 563
 	 * @access    protected
564
+	 * @param EE_Base_Class[] $registrations
564 565
 	 * @return    void
565 566
 	 */
566 567
 	protected function _apply_registration_payments_to_amount_owing( $registrations ) {
@@ -778,7 +779,7 @@  discard block
 block discarded – undo
778 779
 	 * get_billing_form_html_for_payment_method
779 780
 	 *
780 781
 	 * @access public
781
-	 * @return string
782
+	 * @return boolean
782 783
 	 */
783 784
 	public function get_billing_form_html_for_payment_method() {
784 785
 		// how have they chosen to pay?
@@ -898,7 +899,7 @@  discard block
 block discarded – undo
898 899
 	 * switch_payment_method
899 900
 	 *
900 901
 	 * @access public
901
-	 * @return string
902
+	 * @return boolean
902 903
 	 */
903 904
 	public function switch_payment_method() {
904 905
 		if ( ! $this->_verify_payment_method_is_set() ) {
@@ -1065,7 +1066,7 @@  discard block
 block discarded – undo
1065 1066
 
1066 1067
 	/**
1067 1068
 	 * process_reg_step
1068
-	 * @return boolean
1069
+	 * @return null|boolean
1069 1070
 	 */
1070 1071
 	public function process_reg_step() {
1071 1072
 		// how have they chosen to pay?
@@ -1141,7 +1142,7 @@  discard block
 block discarded – undo
1141 1142
 	 *    update_reg_step
1142 1143
 	 *    this is the final step after a user  revisits the site to retry a payment
1143 1144
 	 *
1144
-	 * @return boolean
1145
+	 * @return null|boolean
1145 1146
 	 */
1146 1147
 	public function update_reg_step() {
1147 1148
 		$success = TRUE;
@@ -1426,7 +1427,7 @@  discard block
 block discarded – undo
1426 1427
 	 *
1427 1428
 	 * 	@access 	private
1428 1429
 	 * 	@type 	EE_Payment_Method $payment_method
1429
-	 * 	@return 	mixed	EE_Payment | boolean
1430
+	 * 	@return 	EE_Payment|null	EE_Payment | boolean
1430 1431
 	 */
1431 1432
 	private function _attempt_payment( EE_Payment_Method $payment_method ) {
1432 1433
 		$payment =NULL;
@@ -1619,6 +1620,7 @@  discard block
 block discarded – undo
1619 1620
 	 * @access private
1620 1621
 	 * @type    EE_Payment $payment
1621 1622
 	 * @param string $payment_occurs
1623
+	 * @param EE_Payment|null $payment
1622 1624
 	 * @return bool
1623 1625
 	 * @throws \EE_Error
1624 1626
 	 */
@@ -1722,7 +1724,7 @@  discard block
 block discarded – undo
1722 1724
 	 *        or present the payment options again
1723 1725
 	 *
1724 1726
 	 * @access private
1725
-	 * @return EE_Payment | FALSE
1727
+	 * @return boolean | FALSE
1726 1728
 	 * @throws \EE_Error
1727 1729
 	 */
1728 1730
 	public function process_gateway_response() {
@@ -1784,7 +1786,7 @@  discard block
 block discarded – undo
1784 1786
 	 * _validate_return
1785 1787
 	 *
1786 1788
 	 * @access private
1787
-	 * @return bool
1789
+	 * @return boolean|null
1788 1790
 	 */
1789 1791
 	private function _validate_offsite_return() {
1790 1792
 		$TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 );
@@ -1851,7 +1853,7 @@  discard block
 block discarded – undo
1851 1853
 	 *
1852 1854
 	 * @access private
1853 1855
 	 * @param \EE_Registration $primary_registrant
1854
-	 * @return bool
1856
+	 * @return false|null
1855 1857
 	 */
1856 1858
 	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
1857 1859
 		if ( ! $primary_registrant instanceof EE_Registration ) {
Please login to merge, or discard this patch.
reg_steps/payment_options/events_requiring_pre_approval.template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 
2
-	<h4><span class="orange-text"><?php _e('Important Notice: Events Requiring Pre-Approval', 'event_espresso');?></span></h4>
2
+	<h4><span class="orange-text"><?php _e('Important Notice: Events Requiring Pre-Approval', 'event_espresso'); ?></span></h4>
3 3
 	<p id="events-requiring-pre-approval-pg" class="small-text drk-grey-text">
4 4
 		<?php echo $events_requiring_pre_approval_msg; ?>
5 5
 	</p>
6 6
 	<ul id="spco-pre-approval-events-ul"><?php echo $events_requiring_pre_approval; ?></ul>
7 7
 
8
-	<?php echo $default_hidden_inputs;  ?>
9
-	<?php echo $extra_hidden_inputs;  ?>
8
+	<?php echo $default_hidden_inputs; ?>
9
+	<?php echo $extra_hidden_inputs; ?>
10 10
 
11 11
 	<!--	<input id="reg-page-selected-method-of-payment" type="hidden" value="payments_closed" name="selected_method_of_payment">-->
12 12
 <!--	<input type="hidden" id="reg-page-no-payment-required-payment_options" name="_reg-page-no-payment-required" value="1" />-->
Please login to merge, or discard this patch.
reg_steps/payment_options/no_payment_required.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@
 block discarded – undo
1 1
 <?php
2
-if( is_array( $registrations_for_free_events ) && ! empty( $registrations_for_free_events ) ) {
2
+if (is_array($registrations_for_free_events) && ! empty($registrations_for_free_events)) {
3 3
 	echo apply_filters(
4 4
 		'FHEE__registration_page_payment_options__no_payment_required_hdr',
5 5
 		sprintf(
6
-			__( '%1$sNo Payment Required%2$s', 'event_espresso' ),
6
+			__('%1$sNo Payment Required%2$s', 'event_espresso'),
7 7
 			'<h6>',
8 8
 			'</h6>'
9 9
 		)
10 10
 	);
11
-	foreach ( $registrations_for_free_events as $registration_for_free_event ) {
12
-		if ( $registration_for_free_event instanceof EE_Registration && $registration_for_free_event->ticket()->is_free() ) {
13
-			if ( $registration_for_free_event->event() instanceof EE_Event ) {
11
+	foreach ($registrations_for_free_events as $registration_for_free_event) {
12
+		if ($registration_for_free_event instanceof EE_Registration && $registration_for_free_event->ticket()->is_free()) {
13
+			if ($registration_for_free_event->event() instanceof EE_Event) {
14 14
 				?>
15 15
 				<p>
16 16
 					<?php echo apply_filters(
17 17
 						'FHEE__registration_page_payment_options__no_payment_required_pg',
18 18
 						sprintf(
19
-							__( '"%1$s" for "%2$s" is free, so no payment is required and no billing will occur.', 'event_espresso' ),
19
+							__('"%1$s" for "%2$s" is free, so no payment is required and no billing will occur.', 'event_espresso'),
20 20
 							$registration_for_free_event->ticket()->name(),
21 21
 							$registration_for_free_event->event()->name()
22 22
 						)
Please login to merge, or discard this patch.
single_page_checkout/reg_steps/payment_options/sold_out_events.template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 
2
-	<h4 class="ee-status sold-out"><b><?php _e('Sold Out', 'event_espresso');?></b></h4>
2
+	<h4 class="ee-status sold-out"><b><?php _e('Sold Out', 'event_espresso'); ?></b></h4>
3 3
 	<ul id="spco-sold-out-events-ul"><?php echo $sold_out_events; ?></ul>
4
-	<h6 class="pink-text"><?php _e("We're Sorry", 'event_espresso');?></h6>
4
+	<h6 class="pink-text"><?php _e("We're Sorry", 'event_espresso'); ?></h6>
5 5
 	<p id="events-requiring-pre-approval-pg" class="small-text drk-grey-text">
6 6
 		<?php echo $sold_out_events_msg; ?>
7 7
 	</p>
8 8
 
9
-	<?php echo $default_hidden_inputs;  ?>
10
-	<?php echo $extra_hidden_inputs;  ?>
9
+	<?php echo $default_hidden_inputs; ?>
10
+	<?php echo $extra_hidden_inputs; ?>
Please login to merge, or discard this patch.
single_page_checkout/templates/registration_page_wrapper.template.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <div id="ee-single-page-checkout-dv" class="">
2
-	<?php if ( apply_filters(
2
+	<?php if (apply_filters(
3 3
 			'FHEE__registration_page_wrapper_template__display_time_limit',
4
-			FALSE ) ) { ?>
4
+			FALSE )) { ?>
5 5
 	<p id="spco-registration-time-limit-pg" class="spco-steps-pg ee-attention important-notice">
6 6
 		<?php echo sprintf(
7 7
 			apply_filters(
8 8
 				'FHEE__registration_page_wrapper_template___time_limit',
9 9
 				__('You have %1$s to complete your registration.', 'event_espresso')
10 10
 			),
11
-			'<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">' . $registration_time_limit	. '</span>'
11
+			'<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">'.$registration_time_limit.'</span>'
12 12
 		);
13 13
 		?>
14 14
 		<span id="spco-registration-expiration-spn" class=""
@@ -16,27 +16,27 @@  discard block
 block discarded – undo
16 16
 	</p>
17 17
 	<?php } ?>
18 18
 	<?php
19
-if ( ! $empty_cart ) {
20
-	if ( ! $revisit && apply_filters( 'FHEE__registration_page_wrapper_template__steps_display', TRUE )) {
19
+if ( ! $empty_cart) {
20
+	if ( ! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', TRUE)) {
21 21
 ?>
22 22
 	<h2 id="spco-steps-big-hdr" class="spco-steps-big-hdr"><?php _e(' Steps', 'event_espresso'); ?></h2>
23 23
 
24 24
 	<div id="spco-steps-display-dv">
25 25
 	<?php
26 26
 		$step_nmbr = 1;
27
-		$total_steps = count( $reg_steps ) - 1;
28
-		foreach ( $reg_steps as $reg_step ) {
29
-			if ( $reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration' ) {
27
+		$total_steps = count($reg_steps) - 1;
28
+		foreach ($reg_steps as $reg_step) {
29
+			if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') {
30 30
 				$slug = $reg_step->slug();
31 31
 				$step_display_dv_class = $reg_step->is_current_step() ? 'active-step' : 'inactive-step';
32 32
 		?>
33 33
 		<div id="spco-step-<?php echo $slug; ?>-display-dv" class="spco-step-display-dv <?php echo $step_display_dv_class; ?> steps-<?php echo $total_steps; ?>">
34 34
 			<h4 id="spco-step-<?php echo $slug; ?>-display-hdr" class="spco-steps-display-hdr">
35
-				<span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span>&nbsp;<span class="spco-step-name"><?php echo str_replace( '&nbsp;', '<br/>&nbsp;', $reg_step->name() ); ?></span>
35
+				<span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span>&nbsp;<span class="spco-step-name"><?php echo str_replace('&nbsp;', '<br/>&nbsp;', $reg_step->name()); ?></span>
36 36
 			</h4>
37 37
 		</div>
38 38
 
39
-		<?php if ( $step_nmbr < $total_steps ) { ?>
39
+		<?php if ($step_nmbr < $total_steps) { ?>
40 40
 		<div class="spco-step-arrow-dv">&raquo;</div>
41 41
 		<?php
42 42
 				}
@@ -50,22 +50,22 @@  discard block
 block discarded – undo
50 50
 	<?php
51 51
 	}
52 52
 
53
-	do_action( 'AHEE__SPCO__before_registration_steps' );
53
+	do_action('AHEE__SPCO__before_registration_steps');
54 54
 	$step_nmbr = 1;
55
-	foreach ( $reg_steps as $reg_step ) {
56
-		if ( $reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration' ) {
55
+	foreach ($reg_steps as $reg_step) {
56
+		if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') {
57 57
 			$slug = $reg_step->slug();
58
-			do_action( 'AHEE__' . $slug . '__reg_step_start', $reg_step );
58
+			do_action('AHEE__'.$slug.'__reg_step_start', $reg_step);
59 59
 			// todo: deprecate hook AHEE__registration_page_attendee_information__start
60 60
 	?>
61 61
 		<div id="spco-<?php echo $slug; ?>-dv" class="spco-step-dv <?php echo $reg_step->div_class(); ?>">
62 62
 			<?php echo $reg_step->display_reg_form(); ?>
63
-			<?php do_action( 'AHEE__SPCO_after_reg_step_form', $slug, $next_step ); ?>
63
+			<?php do_action('AHEE__SPCO_after_reg_step_form', $slug, $next_step); ?>
64 64
 		</div>
65 65
 			<?php $step_nmbr++;
66 66
 		}
67 67
 	}
68
-	do_action( 'AHEE__SPCO__after_registration_steps' );
68
+	do_action('AHEE__SPCO__after_registration_steps');
69 69
 
70 70
 } else {
71 71
 ?>
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	<?php echo $cookies_not_set_msg; ?>
75 75
 <?php
76 76
 }
77
-do_action( 'AHEE__SPCO__reg_form_footer' );
77
+do_action('AHEE__SPCO__reg_form_footer');
78 78
 ?>
79 79
 
80 80
 </div>
Please login to merge, or discard this patch.
modules/ticket_selector/EED_Ticket_Selector.module.php 4 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 	protected static $_event = NULL;
36 36
 
37 37
 	/**
38
-	* array of datetimes and the spaces available for them
39
-	*
40
-	* @access private
41
-	* @var array
42
-	*/
38
+	 * array of datetimes and the spaces available for them
39
+	 *
40
+	 * @access private
41
+	 * @var array
42
+	 */
43 43
 	private static $_available_spaces = array();
44 44
 
45 45
 
@@ -855,11 +855,11 @@  discard block
 block discarded – undo
855 855
 
856 856
 
857 857
 	/**
858
-	* 	load js
859
-	*
860
-	* 	@access 		public
861
-	* 	@return 		void
862
-	*/
858
+	 * 	load js
859
+	 *
860
+	 * 	@access 		public
861
+	 * 	@return 		void
862
+	 */
863 863
 	public static function load_tckt_slctr_assets() {
864 864
 		// add some style
865 865
 		if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 	 *
491 491
 	 *	@access public
492 492
 	 * 	@access 		public
493
-	 * 	@return		array  or FALSE
493
+	 * 	@return		boolean|null  or FALSE
494 494
 	 */
495 495
 	public function process_ticket_selections() {
496 496
 		do_action( 'EED_Ticket_Selector__process_ticket_selections__before' );
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 	 *    validate_post_data
636 636
 	 *
637 637
 	 * @access        private
638
-	 * @return        array  or FALSE
638
+	 * @return        string  or FALSE
639 639
 	 */
640 640
 	private static function _validate_post_data() {
641 641
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	 * @access   private
753 753
 	 * @param EE_Ticket $ticket
754 754
 	 * @param int       $qty
755
-	 * @return TRUE on success, FALSE on fail
755
+	 * @return boolean on success, FALSE on fail
756 756
 	 */
757 757
 	private static function _add_ticket_to_cart( EE_Ticket $ticket = NULL, $qty = 1 ) {
758 758
 		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
Please login to merge, or discard this patch.
Spacing   +210 added lines, -210 removed lines patch added patch discarded remove patch
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
 	 * @return EED_Ticket_Selector
58 58
 	 */
59 59
 	public static function instance() {
60
-		return parent::get_instance( __CLASS__ );
60
+		return parent::get_instance(__CLASS__);
61 61
 	}
62 62
 
63 63
 
64 64
 
65
-	protected function set_config(){
66
-		$this->set_config_section( 'template_settings' );
67
-		$this->set_config_class( 'EE_Ticket_Selector_Config' );
68
-		$this->set_config_name( 'EED_Ticket_Selector' );
65
+	protected function set_config() {
66
+		$this->set_config_section('template_settings');
67
+		$this->set_config_class('EE_Ticket_Selector_Config');
68
+		$this->set_config_name('EED_Ticket_Selector');
69 69
 	}
70 70
 
71 71
 
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public static function set_hooks() {
82 82
 		// routing
83
-		EE_Config::register_route( 'iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector' );
84
-		EE_Config::register_route( 'process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections' );
85
-		add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
83
+		EE_Config::register_route('iframe', 'EED_Ticket_Selector', 'ticket_selector_iframe', 'ticket_selector');
84
+		EE_Config::register_route('process_ticket_selections', 'EED_Ticket_Selector', 'process_ticket_selections');
85
+		add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2);
86 86
 		//add_action( 'AHEE_event_details_before_post', array( 'EED_Ticket_Selector', 'ticket_selector_form_open' ), 10, 1 );
87
-		add_action( 'AHEE_event_details_header_bottom', array( 'EED_Ticket_Selector', 'display_ticket_selector' ), 10, 1 );
87
+		add_action('AHEE_event_details_header_bottom', array('EED_Ticket_Selector', 'display_ticket_selector'), 10, 1);
88 88
 		//add_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', array( 'EED_Ticket_Selector', 'display_ticket_selector_submit' ), 10, 1 );
89 89
 		//add_action( 'AHEE_event_details_after_post', array( 'EED_Ticket_Selector', 'ticket_selector_form_close' ), 10 );
90
-		add_action( 'wp_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets' ), 10 );
90
+		add_action('wp_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets'), 10);
91 91
 	}
92 92
 
93 93
 
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 	 *  @return 	void
100 100
 	 */
101 101
 	public static function set_hooks_admin() {
102
-		add_action( 'wp_loaded', array( 'EED_Ticket_Selector', 'set_definitions' ), 2 );
102
+		add_action('wp_loaded', array('EED_Ticket_Selector', 'set_definitions'), 2);
103 103
 		//add button for iframe code to event editor.
104
-		add_filter( 'get_sample_permalink_html', array( 'EED_Ticket_Selector', 'iframe_code_button' ), 10, 4 );
105
-		add_action( 'admin_enqueue_scripts', array( 'EED_Ticket_Selector', 'load_tckt_slctr_assets_admin' ), 10 );
104
+		add_filter('get_sample_permalink_html', array('EED_Ticket_Selector', 'iframe_code_button'), 10, 4);
105
+		add_action('admin_enqueue_scripts', array('EED_Ticket_Selector', 'load_tckt_slctr_assets_admin'), 10);
106 106
 	}
107 107
 
108 108
 
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 	 *  @return 	void
115 115
 	 */
116 116
 	public static function set_definitions() {
117
-		define( 'TICKET_SELECTOR_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
118
-		define( 'TICKET_SELECTOR_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
117
+		define('TICKET_SELECTOR_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
118
+		define('TICKET_SELECTOR_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
119 119
 
120 120
 		//if config is not set, initialize
121 121
 		//If config is not set, set it.
122
-		if ( ! isset( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) ) {
122
+		if ( ! isset(EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector)) {
123 123
 			EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector = new EE_Ticket_Selector_Config();
124 124
 		}
125
-		EE_Registry::$i18n_js_strings[ 'ts_embed_iframe_title' ] = __( 'Copy and Paste the following:', 'event_espresso' );
125
+		EE_Registry::$i18n_js_strings['ts_embed_iframe_title'] = __('Copy and Paste the following:', 'event_espresso');
126 126
 	}
127 127
 
128 128
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * 	@param	object 			$WP
134 134
 	 * 	@return 	void
135 135
 	 */
136
-	public function run( $WP ) {}
136
+	public function run($WP) {}
137 137
 
138 138
 
139 139
 	/**
@@ -145,23 +145,23 @@  discard block
 block discarded – undo
145 145
 	public function ticket_selector_iframe() {
146 146
 		self::$_in_iframe = true;
147 147
 		/** @type EEM_Event $EEM_Event */
148
-		$EEM_Event = EE_Registry::instance()->load_model( 'Event' );
148
+		$EEM_Event = EE_Registry::instance()->load_model('Event');
149 149
 		$event = $EEM_Event->get_one_by_ID(
150
-			EE_Registry::instance()->REQ->get( 'event', 0 )
150
+			EE_Registry::instance()->REQ->get('event', 0)
151 151
 		);
152
-		EE_Registry::instance()->REQ->set_espresso_page( true );
153
-		$template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector( $event );
152
+		EE_Registry::instance()->REQ->set_espresso_page(true);
153
+		$template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector($event);
154 154
 		$template_args['css'] = apply_filters(
155 155
 			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__css',
156 156
 			array(
157
-				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_embed.css?ver=' . EVENT_ESPRESSO_VERSION,
158
-				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css?ver=' . EVENT_ESPRESSO_VERSION,
159
-				includes_url( 'css/dashicons.min.css?ver=' . $GLOBALS['wp_version'] ),
160
-				EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION
157
+				TICKET_SELECTOR_ASSETS_URL.'ticket_selector_embed.css?ver='.EVENT_ESPRESSO_VERSION,
158
+				TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css?ver='.EVENT_ESPRESSO_VERSION,
159
+				includes_url('css/dashicons.min.css?ver='.$GLOBALS['wp_version']),
160
+				EE_GLOBAL_ASSETS_URL.'css/espresso_default.css?ver='.EVENT_ESPRESSO_VERSION
161 161
 			)
162 162
 		);
163
-		EE_Registry::$i18n_js_strings[ 'ticket_selector_iframe' ] = true;
164
-		EE_Registry::$i18n_js_strings[ 'EEDTicketSelectorMsg' ] = __( 'Please choose at least one ticket before continuing.', 'event_espresso' );
163
+		EE_Registry::$i18n_js_strings['ticket_selector_iframe'] = true;
164
+		EE_Registry::$i18n_js_strings['EEDTicketSelectorMsg'] = __('Please choose at least one ticket before continuing.', 'event_espresso');
165 165
 		$template_args['eei18n'] = apply_filters(
166 166
 			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__eei18n_js_strings',
167 167
 			EE_Registry::localize_i18n_js_strings()
@@ -169,19 +169,19 @@  discard block
 block discarded – undo
169 169
 		$template_args['js'] = apply_filters(
170 170
 			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
171 171
 			array(
172
-				includes_url( 'js/jquery/jquery.js?ver=' . $GLOBALS['wp_version'] ),
173
-				EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION,
174
-				TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_iframe_embed.js?ver=' . EVENT_ESPRESSO_VERSION
172
+				includes_url('js/jquery/jquery.js?ver='.$GLOBALS['wp_version']),
173
+				EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js?ver='.EVENT_ESPRESSO_VERSION,
174
+				TICKET_SELECTOR_ASSETS_URL.'ticket_selector_iframe_embed.js?ver='.EVENT_ESPRESSO_VERSION
175 175
 			)
176 176
 		);
177 177
 		EE_Registry::instance()->load_helper('Template');
178
-		$template_args[ 'notices' ] = EEH_Template::display_template(
179
-			EE_TEMPLATES . 'espresso-ajax-notices.template.php',
178
+		$template_args['notices'] = EEH_Template::display_template(
179
+			EE_TEMPLATES.'espresso-ajax-notices.template.php',
180 180
 			array(),
181 181
 			true
182 182
 		);
183 183
 		EEH_Template::display_template(
184
-			TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart_iframe.template.php',
184
+			TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart_iframe.template.php',
185 185
 			$template_args
186 186
 		);
187 187
 		exit;
@@ -200,23 +200,23 @@  discard block
 block discarded – undo
200 200
 	 *
201 201
 	 * @return string The new html string for the permalink area.
202 202
 	 */
203
-	public static function iframe_code_button( $permalink_string, $id, $new_title, $new_slug ) {
203
+	public static function iframe_code_button($permalink_string, $id, $new_title, $new_slug) {
204 204
 		//make sure this is ONLY when editing and the event id has been set.
205
-		if ( ! empty( $id ) )  {
206
-			$post = get_post( $id );
205
+		if ( ! empty($id)) {
206
+			$post = get_post($id);
207 207
 
208 208
 			//if NOT event then let's get out.
209
-			if ( $post->post_type !== 'espresso_events' ) {
209
+			if ($post->post_type !== 'espresso_events') {
210 210
 				return $permalink_string;
211 211
 			}
212 212
 
213
-			$ticket_selector_url = add_query_arg( array( 'ticket_selector' => 'iframe', 'event' => $id ), site_url() );
213
+			$ticket_selector_url = add_query_arg(array('ticket_selector' => 'iframe', 'event' => $id), site_url());
214 214
 
215
-			$permalink_string .= '<a id="js-ticket-selector-embed-trigger" class="button button-small" href="#"  tabindex="-1">' . __('Embed', 'event_espresso') . '</a> ';
215
+			$permalink_string .= '<a id="js-ticket-selector-embed-trigger" class="button button-small" href="#"  tabindex="-1">'.__('Embed', 'event_espresso').'</a> ';
216 216
 			$permalink_string .= '
217 217
 <div id="js-ts-iframe" style="display:none">
218 218
 	<div style="width:100%; height: 500px;">
219
-		<iframe src="' . $ticket_selector_url . '" width="100%" height="100%"></iframe>
219
+		<iframe src="' . $ticket_selector_url.'" width="100%" height="100%"></iframe>
220 220
 	</div>
221 221
 </div>';
222 222
 		}
@@ -235,22 +235,22 @@  discard block
 block discarded – undo
235 235
 	 * @param 	mixed $event
236 236
 	 * @return 	bool
237 237
 	 */
238
-	protected static function set_event( $event = null ) {
239
-		if( $event === null ) {
238
+	protected static function set_event($event = null) {
239
+		if ($event === null) {
240 240
 			global $post;
241 241
 			$event = $post;
242 242
 		}
243
-		if ( $event instanceof EE_Event ) {
243
+		if ($event instanceof EE_Event) {
244 244
 			self::$_event = $event;
245
-		} else if ( $event instanceof WP_Post && isset( $event->EE_Event ) && $event->EE_Event instanceof EE_Event ) {
245
+		} else if ($event instanceof WP_Post && isset($event->EE_Event) && $event->EE_Event instanceof EE_Event) {
246 246
 			self::$_event = $event->EE_Event;
247
-		} else if ( $event instanceof WP_Post && $event->post_type == 'espresso_events' ) {
248
-			$event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object( $event );
247
+		} else if ($event instanceof WP_Post && $event->post_type == 'espresso_events') {
248
+			$event->EE_Event = EEM_Event::instance()->instantiate_class_from_post_object($event);
249 249
 			self::$_event = $event->EE_Event;
250 250
 		} else {
251
-			$user_msg = __( 'No Event object or an invalid Event object was supplied.', 'event_espresso' );
252
-			$dev_msg = $user_msg . __( 'In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso' );
253
-			EE_Error::add_error( $user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ );
251
+			$user_msg = __('No Event object or an invalid Event object was supplied.', 'event_espresso');
252
+			$dev_msg = $user_msg.__('In order to generate a ticket selector, please ensure you are passing either an EE_Event object or a WP_Post object of the post type "espresso_event" to the EE_Ticket_Selector class constructor.', 'event_espresso');
253
+			EE_Error::add_error($user_msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__);
254 254
 			return false;
255 255
 		}
256 256
 		return true;
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 	 * @param 	bool 	$view_details
270 270
 	 * @return 	string
271 271
 	 */
272
-	public static function display_ticket_selector( $event = NULL, $view_details = FALSE ) {
272
+	public static function display_ticket_selector($event = NULL, $view_details = FALSE) {
273 273
 		// reset filter for displaying submit button
274
-		remove_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' );
274
+		remove_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
275 275
 		// poke and prod incoming event till it tells us what it is
276
-		if ( ! EED_Ticket_Selector::set_event( $event )) {
276
+		if ( ! EED_Ticket_Selector::set_event($event)) {
277 277
 			return false;
278 278
 		}
279 279
 		$event_post = self::$_event instanceof EE_Event ? self::$_event->ID() : $event;
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 			&& (
285 285
 				! self::$_event->display_ticket_selector()
286 286
 				|| $view_details
287
-				|| post_password_required( $event_post )
287
+				|| post_password_required($event_post)
288 288
 				|| (
289 289
 					$_event_active_status != EE_Datetime::active
290 290
 					&& $_event_active_status != EE_Datetime::upcoming
@@ -302,70 +302,70 @@  discard block
 block discarded – undo
302 302
 		$template_args = array();
303 303
 		$template_args['event_status'] = $_event_active_status;
304 304
 
305
-		$template_args['date_format'] = apply_filters( 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', get_option( 'date_format' ) );
306
-		$template_args['time_format'] = apply_filters( 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', get_option( 'time_format' ) );
305
+		$template_args['date_format'] = apply_filters('FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', get_option('date_format'));
306
+		$template_args['time_format'] = apply_filters('FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', get_option('time_format'));
307 307
 
308 308
 		$template_args['EVT_ID'] = self::$_event->ID();
309 309
 		$template_args['event'] = self::$_event;
310 310
 
311 311
 		// is the event expired ?
312 312
 		$template_args['event_is_expired'] = self::$_event->is_expired();
313
-		if ( $template_args['event_is_expired'] ) {
314
-			return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( 'We\'re sorry, but all tickets sales have ended because the event is expired.', 'event_espresso' ) . '</span></div>';
313
+		if ($template_args['event_is_expired']) {
314
+			return '<div class="ee-event-expired-notice"><span class="important-notice">'.__('We\'re sorry, but all tickets sales have ended because the event is expired.', 'event_espresso').'</span></div>';
315 315
 		}
316 316
 
317 317
 		$ticket_query_args = array(
318
-			array( 'Datetime.EVT_ID' => self::$_event->ID() ),
319
-			'order_by' => array( 'TKT_order' => 'ASC', 'TKT_required' => 'DESC', 'TKT_start_date' => 'ASC', 'TKT_end_date' => 'ASC' , 'Datetime.DTT_EVT_start' => 'DESC' )
318
+			array('Datetime.EVT_ID' => self::$_event->ID()),
319
+			'order_by' => array('TKT_order' => 'ASC', 'TKT_required' => 'DESC', 'TKT_start_date' => 'ASC', 'TKT_end_date' => 'ASC', 'Datetime.DTT_EVT_start' => 'DESC')
320 320
 		);
321 321
 
322
-		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets ) {
322
+		if ( ! EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector->show_expired_tickets) {
323 323
 			//use the correct applicable time query depending on what version of core is being run.
324
-			$current_time = method_exists( 'EEM_Datetime', 'current_time_for_query' ) ? time() : current_time('timestamp');
325
-			$ticket_query_args[0]['TKT_end_date'] = array( '>', $current_time );
324
+			$current_time = method_exists('EEM_Datetime', 'current_time_for_query') ? time() : current_time('timestamp');
325
+			$ticket_query_args[0]['TKT_end_date'] = array('>', $current_time);
326 326
 		}
327 327
 
328 328
 		// get all tickets for this event ordered by the datetime
329
-		$template_args['tickets'] = EEM_Ticket::instance()->get_all( $ticket_query_args );
329
+		$template_args['tickets'] = EEM_Ticket::instance()->get_all($ticket_query_args);
330 330
 
331
-		if ( count( $template_args['tickets'] ) < 1 ) {
332
-			return '<div class="ee-event-expired-notice"><span class="important-notice">' . __( 'We\'re sorry, but all ticket sales have ended.', 'event_espresso' ) . '</span></div>';
331
+		if (count($template_args['tickets']) < 1) {
332
+			return '<div class="ee-event-expired-notice"><span class="important-notice">'.__('We\'re sorry, but all ticket sales have ended.', 'event_espresso').'</span></div>';
333 333
 		}
334 334
 
335 335
 		// filter the maximum qty that can appear in the Ticket Selector qty dropdowns
336
-		$template_args['max_atndz'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__max_tickets', self::$_event->additional_limit() );
337
-		if ( $template_args['max_atndz'] < 1 ) {
338
-			$sales_closed_msg = __( 'We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', 'event_espresso' );
339
-			if ( current_user_can( 'edit_post', self::$_event->ID() )) {
340
-				$sales_closed_msg .=  sprintf(
341
-					__( '%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s', 'event_espresso' ),
336
+		$template_args['max_atndz'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__max_tickets', self::$_event->additional_limit());
337
+		if ($template_args['max_atndz'] < 1) {
338
+			$sales_closed_msg = __('We\'re sorry, but ticket sales have been closed at this time. Please check back again later.', 'event_espresso');
339
+			if (current_user_can('edit_post', self::$_event->ID())) {
340
+				$sales_closed_msg .= sprintf(
341
+					__('%sNote to Event Admin:%sThe "Maximum number of tickets allowed per order for this event" in the Event Registration Options has been set to "0". This effectively turns off ticket sales. %s(click to edit this event)%s', 'event_espresso'),
342 342
 					'<div class="ee-attention" style="text-align: left;"><b>',
343 343
 					'</b><br />',
344
-					$link = '<span class="edit-link"><a class="post-edit-link" href="' . get_edit_post_link( self::$_event->ID() ) . '">',
344
+					$link = '<span class="edit-link"><a class="post-edit-link" href="'.get_edit_post_link(self::$_event->ID()).'">',
345 345
 					'</a></span></div>'
346 346
 				);
347 347
 			}
348
-			return '<p><span class="important-notice">' . $sales_closed_msg . '</span></p>';
348
+			return '<p><span class="important-notice">'.$sales_closed_msg.'</span></p>';
349 349
 		}
350 350
 
351
-		$templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart.template.php';
352
-		$templates['ticket_selector'] = apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', $templates['ticket_selector'], self::$_event );
351
+		$templates['ticket_selector'] = TICKET_SELECTOR_TEMPLATES_PATH.'ticket_selector_chart.template.php';
352
+		$templates['ticket_selector'] = apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', $templates['ticket_selector'], self::$_event);
353 353
 
354 354
 		// redirecting to another site for registration ??
355 355
 		$external_url = self::$_event->external_url() !== NULL || self::$_event->external_url() !== '' ? self::$_event->external_url() : FALSE;
356 356
 		// set up the form (but not for the admin)
357
-		$ticket_selector = ! is_admin() ? EED_Ticket_Selector::ticket_selector_form_open( self::$_event->ID(), $external_url ) : '';
357
+		$ticket_selector = ! is_admin() ? EED_Ticket_Selector::ticket_selector_form_open(self::$_event->ID(), $external_url) : '';
358 358
 		// if not redirecting to another site for registration
359
-		if ( ! $external_url ) {
360
-			EE_Registry::instance()->load_helper( 'Template' );
361
-			EE_Registry::instance()->load_helper( 'URL' );
359
+		if ( ! $external_url) {
360
+			EE_Registry::instance()->load_helper('Template');
361
+			EE_Registry::instance()->load_helper('URL');
362 362
 			// then display the ticket selector
363
-			$ticket_selector .= EEH_Template::locate_template( $templates['ticket_selector'], $template_args );
363
+			$ticket_selector .= EEH_Template::locate_template($templates['ticket_selector'], $template_args);
364 364
 		} else {
365 365
 			// if not we still need to trigger the display of the submit button
366
-			add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' );
366
+			add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
367 367
 			//display notice to admin that registration is external
368
-			$ticket_selector .= ! is_admin() ? '' : __( 'Registration is at an external URL for this event.', 'event_espresso' );
368
+			$ticket_selector .= ! is_admin() ? '' : __('Registration is at an external URL for this event.', 'event_espresso');
369 369
 		}
370 370
 		// submit button and form close tag
371 371
 		$ticket_selector .= ! is_admin() ? EED_Ticket_Selector::display_ticket_selector_submit() : '';
@@ -385,27 +385,27 @@  discard block
 block discarded – undo
385 385
 	 * @param 		string $external_url
386 386
 	 * @return 		string
387 387
 	 */
388
-	public static function ticket_selector_form_open( $ID = 0, $external_url = '' ) {
388
+	public static function ticket_selector_form_open($ID = 0, $external_url = '') {
389 389
 		// if redirecting, we don't need any anything else
390
-		if ( $external_url ) {
391
-			EE_Registry::instance()->load_helper( 'URL' );
392
-			$html = '<form method="GET" action="' . EEH_URL::refactor_url( $external_url ) . '">';
393
-			$query_args = EEH_URL::get_query_string( $external_url );
394
-			foreach ( $query_args as $query_arg => $value ) {
395
-				$html .= '<input type="hidden" name="' . $query_arg . '" value="' . $value . '">';
390
+		if ($external_url) {
391
+			EE_Registry::instance()->load_helper('URL');
392
+			$html = '<form method="GET" action="'.EEH_URL::refactor_url($external_url).'">';
393
+			$query_args = EEH_URL::get_query_string($external_url);
394
+			foreach ($query_args as $query_arg => $value) {
395
+				$html .= '<input type="hidden" name="'.$query_arg.'" value="'.$value.'">';
396 396
 			}
397 397
 			return $html;
398 398
 		}
399
-		EE_Registry::instance()->load_helper( 'Event_View' );
400
-		$checkout_url = EEH_Event_View::event_link_url( $ID );
401
-		if ( ! $checkout_url ) {
402
-			EE_Error::add_error( __('The URL for the Event Details page could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
399
+		EE_Registry::instance()->load_helper('Event_View');
400
+		$checkout_url = EEH_Event_View::event_link_url($ID);
401
+		if ( ! $checkout_url) {
402
+			EE_Error::add_error(__('The URL for the Event Details page could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
403 403
 		}
404 404
 		$extra_params = self::$_in_iframe ? ' target="_blank"' : '';
405
-		$html = '<form method="POST" action="' . $checkout_url . '"' . $extra_params . '>';
406
-		$html .= wp_nonce_field( 	'process_ticket_selections', 'process_ticket_selections_nonce', TRUE, FALSE );
405
+		$html = '<form method="POST" action="'.$checkout_url.'"'.$extra_params.'>';
406
+		$html .= wp_nonce_field('process_ticket_selections', 'process_ticket_selections_nonce', TRUE, FALSE);
407 407
 		$html .= '<input type="hidden" name="ee" value="process_ticket_selections">';
408
-		$html = apply_filters( 'FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, self::$_event );
408
+		$html = apply_filters('FHEE__EE_Ticket_Selector__ticket_selector_form_open__html', $html, self::$_event);
409 409
 		return $html;
410 410
 	}
411 411
 
@@ -420,23 +420,23 @@  discard block
 block discarded – undo
420 420
 	 * 	@return		string
421 421
 	 */
422 422
 	public static function display_ticket_selector_submit() {
423
-		if ( ! is_admin() ) {
424
-			if ( apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', FALSE ) ) {
423
+		if ( ! is_admin()) {
424
+			if (apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', FALSE)) {
425 425
 				$btn_text = apply_filters(
426 426
 					'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text',
427
-					__('Register Now', 'event_espresso' ),
427
+					__('Register Now', 'event_espresso'),
428 428
 					self::$_event
429 429
 				);
430 430
 				$external_url = self::$_event->external_url();
431
-				$html = '<input id="ticket-selector-submit-'. self::$_event->ID() .'-btn"';
431
+				$html = '<input id="ticket-selector-submit-'.self::$_event->ID().'-btn"';
432 432
 				$html .= ' class="ticket-selector-submit-btn ';
433
-				$html .= empty( $external_url ) ? 'ticket-selector-submit-ajax"' : '"';
434
-				$html .= ' type="submit" value="' . $btn_text . '" />';
435
-				$html .= apply_filters( 'FHEE__EE_Ticket_Selector__after_ticket_selector_submit', '', self::$_event );
433
+				$html .= empty($external_url) ? 'ticket-selector-submit-ajax"' : '"';
434
+				$html .= ' type="submit" value="'.$btn_text.'" />';
435
+				$html .= apply_filters('FHEE__EE_Ticket_Selector__after_ticket_selector_submit', '', self::$_event);
436 436
 				$html .= '<div class="clear"><br/></div></form>';
437 437
 				return $html;
438
-			} else if ( is_archive() ) {
439
-				return EED_Ticket_Selector::ticket_selector_form_close() . EED_Ticket_Selector::display_view_details_btn();
438
+			} else if (is_archive()) {
439
+				return EED_Ticket_Selector::ticket_selector_form_close().EED_Ticket_Selector::display_view_details_btn();
440 440
 			}
441 441
 		}
442 442
 		return '';
@@ -468,13 +468,13 @@  discard block
 block discarded – undo
468 468
 	 * 	@return		string
469 469
 	 */
470 470
 	public static function display_view_details_btn() {
471
-		if ( ! self::$_event->get_permalink() ) {
472
-			EE_Error::add_error( __('The URL for the Event Details page could not be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
471
+		if ( ! self::$_event->get_permalink()) {
472
+			EE_Error::add_error(__('The URL for the Event Details page could not be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
473 473
 		}
474
-		$view_details_btn = '<form method="POST" action="' . self::$_event->get_permalink() . '">';
475
-		$btn_text = apply_filters( 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', __( 'View Details', 'event_espresso' ), self::$_event );
476
-		$view_details_btn .= '<input id="ticket-selector-submit-'. self::$_event->ID() .'-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="' . $btn_text . '" />';
477
-		$view_details_btn .= apply_filters( 'FHEE__EE_Ticket_Selector__after_view_details_btn', '', self::$_event );
474
+		$view_details_btn = '<form method="POST" action="'.self::$_event->get_permalink().'">';
475
+		$btn_text = apply_filters('FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', __('View Details', 'event_espresso'), self::$_event);
476
+		$view_details_btn .= '<input id="ticket-selector-submit-'.self::$_event->ID().'-btn" class="ticket-selector-submit-btn view-details-btn" type="submit" value="'.$btn_text.'" />';
477
+		$view_details_btn .= apply_filters('FHEE__EE_Ticket_Selector__after_view_details_btn', '', self::$_event);
478 478
 		$view_details_btn .= '<div class="clear"><br/></div>';
479 479
 		$view_details_btn .= '</form>';
480 480
 		return $view_details_btn;
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
 	 * 	@return		array  or FALSE
494 494
 	 */
495 495
 	public function process_ticket_selections() {
496
-		do_action( 'EED_Ticket_Selector__process_ticket_selections__before' );
496
+		do_action('EED_Ticket_Selector__process_ticket_selections__before');
497 497
 		// check nonce
498
-		if ( ! is_admin() && ( ! EE_Registry::instance()->REQ->is_set( 'process_ticket_selections_nonce' ) || ! wp_verify_nonce( EE_Registry::instance()->REQ->get( 'process_ticket_selections_nonce' ), 'process_ticket_selections' ))) {
498
+		if ( ! is_admin() && ( ! EE_Registry::instance()->REQ->is_set('process_ticket_selections_nonce') || ! wp_verify_nonce(EE_Registry::instance()->REQ->get('process_ticket_selections_nonce'), 'process_ticket_selections'))) {
499 499
 			EE_Error::add_error(
500
-				sprintf( __( 'We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ),
500
+				sprintf(__('We\'re sorry but your request failed to pass a security check.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'),
501 501
 				__FILE__, __FUNCTION__, __LINE__
502 502
 			);
503 503
 			return FALSE;
@@ -511,16 +511,16 @@  discard block
 block discarded – undo
511 511
 
512 512
 		//we should really only have 1 registration in the works now (ie, no MER) so clear any previous items in the cart.
513 513
 		// When MER happens this will probably need to be tweaked, possibly wrapped in a conditional checking for some constant defined in MER etc.
514
-		EE_Registry::instance()->load_core( 'Session' );
514
+		EE_Registry::instance()->load_core('Session');
515 515
 		// unless otherwise requested, clear the session
516
-		if ( apply_filters( 'FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', TRUE )) {
517
-			EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ );
516
+		if (apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__clear_session', TRUE)) {
517
+			EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__);
518 518
 		}
519 519
 		//d( EE_Registry::instance()->SSN );
520 520
 
521
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
521
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
522 522
 		// do we have an event id?
523
-		if ( EE_Registry::instance()->REQ->is_set( 'tkt-slctr-event-id' ) ) {
523
+		if (EE_Registry::instance()->REQ->is_set('tkt-slctr-event-id')) {
524 524
 			// validate/sanitize data
525 525
 			$valid = self::_validate_post_data();
526 526
 
@@ -530,41 +530,41 @@  discard block
 block discarded – undo
530 530
 			//EEH_Debug_Tools::printr( $valid[ 'max_atndz' ], 'max_atndz', __FILE__, __LINE__ );
531 531
 
532 532
 			//check total tickets ordered vs max number of attendees that can register
533
-			if ( $valid['total_tickets'] > $valid['max_atndz'] ) {
533
+			if ($valid['total_tickets'] > $valid['max_atndz']) {
534 534
 
535 535
 				// ordering too many tickets !!!
536 536
 				$total_tickets_string = _n('You have attempted to purchase %s ticket.', 'You have attempted to purchase %s tickets.', $valid['total_tickets'], 'event_espresso');
537
-				$limit_error_1 = sprintf( $total_tickets_string, $valid['total_tickets'] );
537
+				$limit_error_1 = sprintf($total_tickets_string, $valid['total_tickets']);
538 538
 				// dev only message
539 539
 				$max_atndz_string = _n('The registration limit for this event is %s ticket per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.', 'The registration limit for this event is %s tickets per registration, therefore the total number of tickets you may purchase at a time can not exceed %s.', $valid['max_atndz'], 'event_espresso');
540
-				$limit_error_2 = sprintf( $max_atndz_string, $valid['max_atndz'], $valid['max_atndz'] );
541
-				EE_Error::add_error( $limit_error_1 . '<br/>' . $limit_error_2, __FILE__, __FUNCTION__, __LINE__ );
540
+				$limit_error_2 = sprintf($max_atndz_string, $valid['max_atndz'], $valid['max_atndz']);
541
+				EE_Error::add_error($limit_error_1.'<br/>'.$limit_error_2, __FILE__, __FUNCTION__, __LINE__);
542 542
 			} else {
543 543
 
544 544
 				// all data appears to be valid
545 545
 				$tckts_slctd = FALSE;
546 546
 				$success = TRUE;
547 547
 				// load cart
548
-				EE_Registry::instance()->load_core( 'Cart' );
548
+				EE_Registry::instance()->load_core('Cart');
549 549
 
550 550
 				// cycle thru the number of data rows sent from the event listing
551
-				for ( $x = 0; $x < $valid['rows']; $x++ ) {
551
+				for ($x = 0; $x < $valid['rows']; $x++) {
552 552
 					// does this row actually contain a ticket quantity?
553
-					if ( isset( $valid['qty'][$x] ) && $valid['qty'][$x] > 0 ) {
553
+					if (isset($valid['qty'][$x]) && $valid['qty'][$x] > 0) {
554 554
 						// YES we have a ticket quantity
555 555
 						$tckts_slctd = TRUE;
556 556
 						//						d( $valid['ticket_obj'][$x] );
557
-						if ( $valid['ticket_obj'][$x] instanceof EE_Ticket ) {
557
+						if ($valid['ticket_obj'][$x] instanceof EE_Ticket) {
558 558
 							// then add ticket to cart
559
-							$ticket_added = self::_add_ticket_to_cart( $valid['ticket_obj'][$x], $valid['qty'][$x] );
559
+							$ticket_added = self::_add_ticket_to_cart($valid['ticket_obj'][$x], $valid['qty'][$x]);
560 560
 							$success = ! $ticket_added ? FALSE : $success;
561
-							if ( EE_Error::has_error() ) {
561
+							if (EE_Error::has_error()) {
562 562
 								break;
563 563
 							}
564 564
 						} else {
565 565
 							// nothing added to cart retrieved
566 566
 							EE_Error::add_error(
567
-								sprintf( __( 'A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ),
567
+								sprintf(__('A valid ticket could not be retrieved for the event.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'),
568 568
 								__FILE__, __FUNCTION__, __LINE__
569 569
 							);
570 570
 						}
@@ -573,45 +573,45 @@  discard block
 block discarded – undo
573 573
 				//d( EE_Registry::instance()->CART );
574 574
 				//die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL REDIRECT HERE BEFORE CART UPDATE
575 575
 
576
-				if ( $tckts_slctd ) {
577
-					if ( $success ) {
578
-						do_action( 'FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout', EE_Registry::instance()->CART, $this );
576
+				if ($tckts_slctd) {
577
+					if ($success) {
578
+						do_action('FHEE__EE_Ticket_Selector__process_ticket_selections__before_redirecting_to_checkout', EE_Registry::instance()->CART, $this);
579 579
 						EE_Registry::instance()->CART->recalculate_all_cart_totals();
580
-						EE_Registry::instance()->CART->save_cart( FALSE );
580
+						EE_Registry::instance()->CART->save_cart(FALSE);
581 581
 						EE_Registry::instance()->SSN->update();
582 582
 						//d( EE_Registry::instance()->CART );
583 583
 						//die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< OR HERE TO KILL REDIRECT AFTER CART UPDATE
584 584
 						// just return TRUE for registrations being made from admin
585
-						if ( is_admin() ) {
585
+						if (is_admin()) {
586 586
 							return TRUE;
587 587
 						}
588
-						wp_safe_redirect( apply_filters( 'FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url', EE_Registry::instance()->CFG->core->reg_page_url() ));
588
+						wp_safe_redirect(apply_filters('FHEE__EE_Ticket_Selector__process_ticket_selections__success_redirect_url', EE_Registry::instance()->CFG->core->reg_page_url()));
589 589
 						exit();
590 590
 
591 591
 					} else {
592
-						if ( ! EE_Error::has_error() ) {
592
+						if ( ! EE_Error::has_error()) {
593 593
 							// nothing added to cart
594
-							EE_Error::add_attention( __( 'No tickets were added for the event', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
594
+							EE_Error::add_attention(__('No tickets were added for the event', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
595 595
 						}
596 596
 					}
597 597
 
598 598
 				} else {
599 599
 					// no ticket quantities were selected
600
-					EE_Error::add_error( __( 'You need to select a ticket quantity before you can proceed.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
600
+					EE_Error::add_error(__('You need to select a ticket quantity before you can proceed.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
601 601
 				}
602 602
 			}
603 603
 			//die(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< KILL BEFORE REDIRECT
604 604
 			// at this point, just return if registration is being made from admin
605
-			if ( is_admin() ) {
605
+			if (is_admin()) {
606 606
 				return FALSE;
607 607
 			}
608
-			if ( $valid['return_url'] ) {
609
-				EE_Error::get_notices( FALSE, TRUE );
610
-				wp_safe_redirect( $valid['return_url'] );
608
+			if ($valid['return_url']) {
609
+				EE_Error::get_notices(FALSE, TRUE);
610
+				wp_safe_redirect($valid['return_url']);
611 611
 				exit();
612
-			} elseif ( isset( $event_to_add['id'] )) {
613
-				EE_Error::get_notices( FALSE, TRUE );
614
-				wp_safe_redirect( get_permalink( $event_to_add['id'] ));
612
+			} elseif (isset($event_to_add['id'])) {
613
+				EE_Error::get_notices(FALSE, TRUE);
614
+				wp_safe_redirect(get_permalink($event_to_add['id']));
615 615
 				exit();
616 616
 			} else {
617 617
 				echo EE_Error::get_notices();
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 		} else {
621 621
 			// $_POST['tkt-slctr-event-id'] was not set ?!?!?!?
622 622
 			EE_Error::add_error(
623
-				sprintf( __( 'An event id was not provided or was not received.%sPlease click the back button on your browser and try again.', 'event_espresso' ), '<br/>' ),
623
+				sprintf(__('An event id was not provided or was not received.%sPlease click the back button on your browser and try again.', 'event_espresso'), '<br/>'),
624 624
 				__FILE__, __FUNCTION__, __LINE__
625 625
 			);
626 626
 		}
@@ -638,18 +638,18 @@  discard block
 block discarded – undo
638 638
 	 * @return        array  or FALSE
639 639
 	 */
640 640
 	private static function _validate_post_data() {
641
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
641
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
642 642
 
643 643
 		// start with an empty array()
644 644
 		$valid_data = array();
645 645
 		//		d( $_POST );
646 646
 		//if event id is valid
647
-		$id = absint( EE_Registry::instance()->REQ->get( 'tkt-slctr-event-id' ));
648
-		if ( $id ) {
647
+		$id = absint(EE_Registry::instance()->REQ->get('tkt-slctr-event-id'));
648
+		if ($id) {
649 649
 			// grab valid id
650 650
 			$valid_data['id'] = $id;
651 651
 			// grab and sanitize return-url
652
-			$valid_data['return_url'] = esc_url_raw( EE_Registry::instance()->REQ->get( 'tkt-slctr-return-url-' . $id ));
652
+			$valid_data['return_url'] = esc_url_raw(EE_Registry::instance()->REQ->get('tkt-slctr-return-url-'.$id));
653 653
 			// array of other form names
654 654
 			$inputs_to_clean = array(
655 655
 				'event_id' => 'tkt-slctr-event-id',
@@ -662,22 +662,22 @@  discard block
 block discarded – undo
662 662
 			// let's track the total number of tickets ordered.'
663 663
 			$valid_data['total_tickets'] = 0;
664 664
 			// cycle through $inputs_to_clean array
665
-			foreach ( $inputs_to_clean as $what => $input_to_clean ) {
665
+			foreach ($inputs_to_clean as $what => $input_to_clean) {
666 666
 				// check for POST data
667
-				if ( EE_Registry::instance()->REQ->is_set( $input_to_clean . $id )) {
667
+				if (EE_Registry::instance()->REQ->is_set($input_to_clean.$id)) {
668 668
 					// grab value
669
-					$input_value = EE_Registry::instance()->REQ->get( $input_to_clean . $id );
669
+					$input_value = EE_Registry::instance()->REQ->get($input_to_clean.$id);
670 670
 					switch ($what) {
671 671
 
672 672
 						// integers
673 673
 						case 'event_id':
674
-							$valid_data[$what] = absint( $input_value );
674
+							$valid_data[$what] = absint($input_value);
675 675
 							// get event via the event id we put in the form
676
-							$valid_data['event'] = EE_Registry::instance()->load_model( 'Event' )->get_one_by_ID( $valid_data['event_id'] );
676
+							$valid_data['event'] = EE_Registry::instance()->load_model('Event')->get_one_by_ID($valid_data['event_id']);
677 677
 							break;
678 678
 						case 'rows':
679 679
 						case 'max_atndz':
680
-							$valid_data[$what] = absint( $input_value );
680
+							$valid_data[$what] = absint($input_value);
681 681
 							break;
682 682
 
683 683
 						// arrays of integers
@@ -685,27 +685,27 @@  discard block
 block discarded – undo
685 685
 							//							d( $input_value );
686 686
 							$row_qty = $input_value;
687 687
 							// if qty is coming from a radio button input, then we need to assemble an array of rows
688
-							if( ! is_array( $row_qty )) {
688
+							if ( ! is_array($row_qty)) {
689 689
 								// get number of rows
690
-								$rows = EE_Registry::instance()->REQ->is_set( 'tkt-slctr-rows-' . $id ) ? absint( EE_Registry::instance()->REQ->get( 'tkt-slctr-rows-' . $id )) : 1;
690
+								$rows = EE_Registry::instance()->REQ->is_set('tkt-slctr-rows-'.$id) ? absint(EE_Registry::instance()->REQ->get('tkt-slctr-rows-'.$id)) : 1;
691 691
 								//								d( $rows );
692 692
 								// explode ints by the dash
693
-								$row_qty = explode( '-', $row_qty );
694
-								$row = isset( $row_qty[0] ) ? ( absint( $row_qty[0] )) : 1;
695
-								$qty = isset( $row_qty[1] ) ? absint( $row_qty[1] ) : 0;
696
-								$row_qty = array( $row => $qty );
693
+								$row_qty = explode('-', $row_qty);
694
+								$row = isset($row_qty[0]) ? (absint($row_qty[0])) : 1;
695
+								$qty = isset($row_qty[1]) ? absint($row_qty[1]) : 0;
696
+								$row_qty = array($row => $qty);
697 697
 								//								 d( $row_qty );
698
-								for( $x = 1; $x <= $rows; $x++ ) {
699
-									if ( ! isset( $row_qty[$x] )) {
698
+								for ($x = 1; $x <= $rows; $x++) {
699
+									if ( ! isset($row_qty[$x])) {
700 700
 										$row_qty[$x] = 0;
701 701
 									}
702 702
 								}
703 703
 							}
704
-							ksort( $row_qty );
704
+							ksort($row_qty);
705 705
 							//							 d( $row_qty );
706 706
 							// cycle thru values
707
-							foreach ( $row_qty as $qty ) {
708
-								$qty = absint( $qty );
707
+							foreach ($row_qty as $qty) {
708
+								$qty = absint($qty);
709 709
 								// sanitize as integers
710 710
 								$valid_data[$what][] = $qty;
711 711
 								$valid_data['total_tickets'] += $qty;
@@ -716,19 +716,19 @@  discard block
 block discarded – undo
716 716
 						case 'ticket_id':
717 717
 							$value_array = array();
718 718
 							// cycle thru values
719
-							foreach ( $input_value as $key=>$value ) {
719
+							foreach ($input_value as $key=>$value) {
720 720
 								// allow only numbers, letters,  spaces, commas and dashes
721
-								$value_array[ $key ] = wp_strip_all_tags( $value );
721
+								$value_array[$key] = wp_strip_all_tags($value);
722 722
 								// get ticket via the ticket id we put in the form
723
-								$ticket_obj = EE_Registry::instance()->load_model( 'Ticket' )->get_one_by_ID( $value );
724
-								$valid_data['ticket_obj'][ $key ] = $ticket_obj;
723
+								$ticket_obj = EE_Registry::instance()->load_model('Ticket')->get_one_by_ID($value);
724
+								$valid_data['ticket_obj'][$key] = $ticket_obj;
725 725
 							}
726
-							$valid_data[ $what ] = $value_array;
726
+							$valid_data[$what] = $value_array;
727 727
 							break;
728 728
 
729 729
 						case 'return_url' :
730 730
 							// grab and sanitize return-url
731
-							$valid_data[$what] = esc_url_raw( $input_value );
731
+							$valid_data[$what] = esc_url_raw($input_value);
732 732
 							break;
733 733
 
734 734
 					} 	// end switch $what
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 			} 	// end foreach $inputs_to_clean
737 737
 
738 738
 		} else {
739
-			EE_Error::add_error( __('The event id provided was not valid.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
739
+			EE_Error::add_error(__('The event id provided was not valid.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
740 740
 			return FALSE;
741 741
 		}
742 742
 
@@ -754,28 +754,28 @@  discard block
 block discarded – undo
754 754
 	 * @param int       $qty
755 755
 	 * @return TRUE on success, FALSE on fail
756 756
 	 */
757
-	private static function _add_ticket_to_cart( EE_Ticket $ticket = NULL, $qty = 1 ) {
758
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
757
+	private static function _add_ticket_to_cart(EE_Ticket $ticket = NULL, $qty = 1) {
758
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
759 759
 		// get the number of spaces left for this datetime ticket
760
-		$available_spaces = self::_ticket_datetime_availability( $ticket );
760
+		$available_spaces = self::_ticket_datetime_availability($ticket);
761 761
 		// compare available spaces against the number of tickets being purchased
762
-		if ( $available_spaces >= $qty ) {
762
+		if ($available_spaces >= $qty) {
763 763
 			// allow addons to prevent a ticket from being added to cart
764
-			if ( ! apply_filters( 'FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart', true, $ticket, $qty, $available_spaces ) ) {
764
+			if ( ! apply_filters('FHEE__EE_Ticket_Selector___add_ticket_to_cart__allow_add_to_cart', true, $ticket, $qty, $available_spaces)) {
765 765
 				return false;
766 766
 			}
767 767
 			// add event to cart
768
-			if( EE_Registry::instance()->CART->add_ticket_to_cart( $ticket, $qty )) {
769
-				self::_recalculate_ticket_datetime_availability( $ticket, $qty );
768
+			if (EE_Registry::instance()->CART->add_ticket_to_cart($ticket, $qty)) {
769
+				self::_recalculate_ticket_datetime_availability($ticket, $qty);
770 770
 				return true;
771 771
 			} else {
772 772
 				return false;
773 773
 			}
774 774
 		} else {
775 775
 			// tickets can not be purchased but let's find the exact number left for the last ticket selected PRIOR to subtracting tickets
776
-			$available_spaces = self::_ticket_datetime_availability( $ticket, true );
776
+			$available_spaces = self::_ticket_datetime_availability($ticket, true);
777 777
 			// greedy greedy greedy eh?
778
-			if ( $available_spaces > 0 ) {
778
+			if ($available_spaces > 0) {
779 779
 				// add error messaging - we're using the _n function that will generate the appropriate singular or plural message based on the number of $available_spaces
780 780
 				EE_Error::add_error(
781 781
 					sprintf(
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 					__FILE__, __FUNCTION__, __LINE__
792 792
 				);
793 793
 			} else {
794
-				EE_Error::add_error( __('We\'re sorry, but there are no available spaces left for this event at this particular date and time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
794
+				EE_Error::add_error(__('We\'re sorry, but there are no available spaces left for this event at this particular date and time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
795 795
 			}
796 796
 			return false;
797 797
 		}
@@ -809,22 +809,22 @@  discard block
 block discarded – undo
809 809
 	 * @param 	bool         $get_original_ticket_spaces
810 810
 	 * @return 	int
811 811
 	 */
812
-	private static function _ticket_datetime_availability( EE_Ticket $ticket, $get_original_ticket_spaces = FALSE ) {
812
+	private static function _ticket_datetime_availability(EE_Ticket $ticket, $get_original_ticket_spaces = FALSE) {
813 813
 		// if the $_available_spaces array has not been set up yet...
814
-		if ( ! isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) {
815
-				self::_set_initial_ticket_datetime_availability( $ticket );
814
+		if ( ! isset(self::$_available_spaces['tickets'][$ticket->ID()])) {
815
+				self::_set_initial_ticket_datetime_availability($ticket);
816 816
 		}
817 817
 		$available_spaces = $ticket->qty() - $ticket->sold();
818
-		if ( isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) {
818
+		if (isset(self::$_available_spaces['tickets'][$ticket->ID()])) {
819 819
 			// loop thru tickets, which will ALSO include individual ticket records AND a total
820
-			foreach ( self::$_available_spaces['tickets'][ $ticket->ID() ] as $DTD_ID => $spaces  ) {
820
+			foreach (self::$_available_spaces['tickets'][$ticket->ID()] as $DTD_ID => $spaces) {
821 821
 				// if we want the original datetime availability BEFORE we started subtracting tickets ?
822
-				if ( $get_original_ticket_spaces ) {
822
+				if ($get_original_ticket_spaces) {
823 823
 					// then grab the available spaces from the "tickets" array and compare with the above to get the lowest number
824
-					$available_spaces = min( $available_spaces, self::$_available_spaces['tickets'][ $ticket->ID() ][ $DTD_ID ] );
824
+					$available_spaces = min($available_spaces, self::$_available_spaces['tickets'][$ticket->ID()][$DTD_ID]);
825 825
 				} else {
826 826
 					// we want the updated ticket availability as stored in the "datetimes" array
827
-					$available_spaces = min( $available_spaces, self::$_available_spaces['datetimes'][ $DTD_ID ] );
827
+					$available_spaces = min($available_spaces, self::$_available_spaces['datetimes'][$DTD_ID]);
828 828
 				}
829 829
 			}
830 830
 		}
@@ -840,23 +840,23 @@  discard block
 block discarded – undo
840 840
 	 * @param 	EE_Ticket $ticket
841 841
 	 * @return 	int
842 842
 	 */
843
-	private static function _set_initial_ticket_datetime_availability( EE_Ticket $ticket ) {
843
+	private static function _set_initial_ticket_datetime_availability(EE_Ticket $ticket) {
844 844
 		// first, get all of the datetimes that are available to this ticket
845 845
 		$datetimes = $ticket->get_many_related(
846 846
 			'Datetime',
847
-			array( array( 'DTT_EVT_end' => array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) ) ), 'order_by' => array( 'DTT_EVT_start' => 'ASC' ))
847
+			array(array('DTT_EVT_end' => array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end'))), 'order_by' => array('DTT_EVT_start' => 'ASC'))
848 848
 		);
849
-		if ( ! empty( $datetimes )) {
849
+		if ( ! empty($datetimes)) {
850 850
 			// now loop thru all of the datetimes
851
-			foreach ( $datetimes as $datetime  ) {
852
-				if ( $datetime instanceof EE_Datetime ) {
851
+			foreach ($datetimes as $datetime) {
852
+				if ($datetime instanceof EE_Datetime) {
853 853
 					// the number of spaces available for the datetime without considering individual ticket quantities
854 854
 					$spaces_remaining = $datetime->spaces_remaining();
855 855
 					// save the total available spaces ( the lesser of the ticket qty minus the number of tickets sold or the datetime spaces remaining) to this ticket using the datetime ID as the key
856
-					self::$_available_spaces['tickets'][ $ticket->ID() ][ $datetime->ID() ] = min(( $ticket->qty() - $ticket->sold() ), $spaces_remaining );
856
+					self::$_available_spaces['tickets'][$ticket->ID()][$datetime->ID()] = min(($ticket->qty() - $ticket->sold()), $spaces_remaining);
857 857
 					// if the remaining spaces for this datetime is already set, then compare that against the datetime spaces remaining, and take the lowest number,
858 858
 					// else just take the datetime spaces remaining, and assign to the datetimes array
859
-					self::$_available_spaces['datetimes'][ $datetime->ID() ] = isset( self::$_available_spaces['datetimes'][ $datetime->ID() ] ) ? min( self::$_available_spaces['datetimes'][ $datetime->ID() ], $spaces_remaining ) : $spaces_remaining;
859
+					self::$_available_spaces['datetimes'][$datetime->ID()] = isset(self::$_available_spaces['datetimes'][$datetime->ID()]) ? min(self::$_available_spaces['datetimes'][$datetime->ID()], $spaces_remaining) : $spaces_remaining;
860 860
 				}
861 861
 			}
862 862
 		}
@@ -872,12 +872,12 @@  discard block
 block discarded – undo
872 872
 	 * @param 	int   $qty
873 873
 	 * @return 	int
874 874
 	 */
875
-	private static function _recalculate_ticket_datetime_availability( EE_Ticket $ticket, $qty = 0 ) {
876
-		if ( isset( self::$_available_spaces['tickets'][ $ticket->ID() ] )) {
875
+	private static function _recalculate_ticket_datetime_availability(EE_Ticket $ticket, $qty = 0) {
876
+		if (isset(self::$_available_spaces['tickets'][$ticket->ID()])) {
877 877
 			// loop thru tickets, which will ALSO include individual ticket records AND a total
878
-			foreach ( self::$_available_spaces['tickets'][ $ticket->ID() ] as $DTD_ID => $spaces  ) {
878
+			foreach (self::$_available_spaces['tickets'][$ticket->ID()] as $DTD_ID => $spaces) {
879 879
 				// subtract the qty of selected tickets from each datetime's available spaces this ticket has access to,
880
-				self::$_available_spaces['datetimes'][ $DTD_ID ] = self::$_available_spaces['datetimes'][ $DTD_ID ] - $qty;
880
+				self::$_available_spaces['datetimes'][$DTD_ID] = self::$_available_spaces['datetimes'][$DTD_ID] - $qty;
881 881
 			}
882 882
 		}
883 883
 	}
@@ -894,8 +894,8 @@  discard block
 block discarded – undo
894 894
 	*/
895 895
 	public static function load_tckt_slctr_assets() {
896 896
 		// add some style
897
-		if ( apply_filters( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE ) ) {
898
-			wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css');
897
+		if (apply_filters('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', FALSE)) {
898
+			wp_register_style('ticket_selector', TICKET_SELECTOR_ASSETS_URL.'ticket_selector.css');
899 899
 			wp_enqueue_style('ticket_selector');
900 900
 			// make it dance
901 901
 			//			wp_register_script('ticket_selector', TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.js', array('espresso_core'), '', TRUE);
@@ -909,9 +909,9 @@  discard block
 block discarded – undo
909 909
 
910 910
 	public static function load_tckt_slctr_assets_admin() {
911 911
 		//iframe button js on admin event editor page
912
-		if ( EE_Registry::instance()->REQ->get('page') == 'espresso_events' && EE_Registry::instance()->REQ->get('action') == 'edit' ) {
913
-			wp_register_script( 'ticket_selector_embed', TICKET_SELECTOR_ASSETS_URL . 'ticket-selector-embed.js', array( 'ee-dialog' ), EVENT_ESPRESSO_VERSION, true );
914
-			wp_enqueue_script( 'ticket_selector_embed' );
912
+		if (EE_Registry::instance()->REQ->get('page') == 'espresso_events' && EE_Registry::instance()->REQ->get('action') == 'edit') {
913
+			wp_register_script('ticket_selector_embed', TICKET_SELECTOR_ASSETS_URL.'ticket-selector-embed.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, true);
914
+			wp_enqueue_script('ticket_selector_embed');
915 915
 		}
916 916
 	}
917 917
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_selector_chart.template.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
33 33
 				<th scope="col" class="ee-ticket-selector-ticket-qty-th cntr">
34 34
 					<?php
35 35
 						/**
36
-						* Filters the text printed for the header of the quantity column in the ticket selector table
37
-						*
38
-						* @since 4.7.2
39
-						*
40
-						* @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets
41
-						* @param int $EVT_ID The Event ID
42
-						*/
36
+						 * Filters the text printed for the header of the quantity column in the ticket selector table
37
+						 *
38
+						 * @since 4.7.2
39
+						 *
40
+						 * @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets
41
+						 * @param int $EVT_ID The Event ID
42
+						 */
43 43
 						echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_qty', __( 'Qty*', 'event_espresso' ), $EVT_ID ) );
44 44
 					?>
45 45
 				</th>
Please login to merge, or discard this patch.
Spacing   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -8,32 +8,32 @@  discard block
 block discarded – undo
8 8
 
9 9
 $row = 1;
10 10
 $max = 1;
11
-$ticket_count = count( $tickets );
11
+$ticket_count = count($tickets);
12 12
 
13
-if ( ! $ticket_count ) {
13
+if ( ! $ticket_count) {
14 14
 	return;
15 15
 }
16 16
 
17 17
 $required_ticket_sold_out = FALSE;
18
-$template_settings = isset ( EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector ) ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector : new EE_Ticket_Selector_Config();
18
+$template_settings = isset (EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector) ? EE_Registry::instance()->CFG->template_settings->EED_Ticket_Selector : new EE_Ticket_Selector_Config();
19 19
 ob_start();
20 20
 
21
-foreach ( $tickets as $TKT_ID => $ticket ) {
22
-	if ( $ticket instanceof EE_Ticket ) {
21
+foreach ($tickets as $TKT_ID => $ticket) {
22
+	if ($ticket instanceof EE_Ticket) {
23 23
 		//	d( $ticket );
24
-		$max =$ticket->max();
24
+		$max = $ticket->max();
25 25
 		$min = 0;
26 26
 		$remaining = $ticket->remaining();
27
-		if ( $ticket->is_on_sale() && $ticket->is_remaining() ) {
27
+		if ($ticket->is_on_sale() && $ticket->is_remaining()) {
28 28
 			// offer the number of $tickets_remaining or $max_atndz, whichever is smaller
29
-			$max = min( $remaining, $max_atndz );
29
+			$max = min($remaining, $max_atndz);
30 30
 			// but... we also want to restrict the number of tickets by the ticket max setting,
31 31
 			// however, the max still can't be higher than what was just set above
32
-			$max = $ticket->max() > 0 ? min( $ticket->max(), $max ) : $max;
32
+			$max = $ticket->max() > 0 ? min($ticket->max(), $max) : $max;
33 33
 			// and we also want to restrict the minimum number of tickets by the ticket min setting
34 34
 			$min = $ticket->min() > 0 ? $ticket->min() : 0;
35 35
 			// and if the ticket is required, then make sure that min qty is at least 1
36
-			$min = $ticket->required() ? max( $min, 1 ) : $min;
36
+			$min = $ticket->required() ? max($min, 1) : $min;
37 37
 		} else {
38 38
 			// set flag if ticket is required (flag is set to start date so that future tickets are not blocked)
39 39
 			$required_ticket_sold_out = $ticket->required() && ! $remaining ? $ticket->start_date() : $required_ticket_sold_out;
@@ -42,40 +42,40 @@  discard block
 block discarded – undo
42 42
 		$ticket_price = $ticket->get_ticket_total_with_taxes();
43 43
 		$ticket_bundle = FALSE;
44 44
 		// for ticket bundles, set min and max qty the same
45
-		if ( $ticket->min() != 0 && $ticket->min() == $ticket->max() ) {
45
+		if ($ticket->min() != 0 && $ticket->min() == $ticket->max()) {
46 46
 			$ticket_price = $ticket_price * $ticket->min();
47 47
 			$ticket_bundle = TRUE;
48 48
 		}
49
-		$ticket_price = apply_filters( 'FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket );
49
+		$ticket_price = apply_filters('FHEE__ticket_selector_chart_template__ticket_price', $ticket_price, $ticket);
50 50
 		// if a previous required ticket with the same sale start date is sold out, then mark this ticket as sold out as well.
51 51
 		// tickets that go on sale at a later date than the required ticket  will NOT be affected
52 52
 		$tkt_status = $required_ticket_sold_out !== FALSE && $required_ticket_sold_out === $ticket->start_date() ? EE_Ticket::sold_out : $ticket->ticket_status();
53 53
 		$tkt_status = $event_status === EE_Datetime::sold_out ? EE_Ticket::sold_out : $tkt_status;
54 54
 		// check ticket status
55
-		switch ( $tkt_status ) {
55
+		switch ($tkt_status) {
56 56
 			// sold_out
57 57
 			case EE_Ticket::sold_out :
58
-				$ticket_status = '<span class="ticket-sales-sold-out">' . $ticket->ticket_status( TRUE ) . '</span>';
58
+				$ticket_status = '<span class="ticket-sales-sold-out">'.$ticket->ticket_status(TRUE).'</span>';
59 59
 				$status_class = 'ticket-sales-sold-out lt-grey-text';
60 60
 			break;
61 61
 			// expired
62 62
 			case EE_Ticket::expired :
63
-				$ticket_status = '<span class="ticket-sales-expired">' . $ticket->ticket_status( TRUE ) . '</span>';
63
+				$ticket_status = '<span class="ticket-sales-expired">'.$ticket->ticket_status(TRUE).'</span>';
64 64
 				$status_class = 'ticket-sales-expired lt-grey-text';
65 65
 			break;
66 66
 			// archived
67 67
 			case EE_Ticket::archived :
68
-				$ticket_status = '<span class="archived-ticket">' . $ticket->ticket_status( TRUE ) . '</span>';
68
+				$ticket_status = '<span class="archived-ticket">'.$ticket->ticket_status(TRUE).'</span>';
69 69
 				$status_class = 'archived-ticket hidden';
70 70
 			break;
71 71
 			// pending
72 72
 			case EE_Ticket::pending :
73
-				$ticket_status = '<span class="ticket-pending">' . $ticket->ticket_status( TRUE ) . '</span>';
73
+				$ticket_status = '<span class="ticket-pending">'.$ticket->ticket_status(TRUE).'</span>';
74 74
 				$status_class = 'ticket-pending';
75 75
 			break;
76 76
 			// onsale
77 77
 			case EE_Ticket::onsale :
78
-				$ticket_status = '<span class="ticket-on-sale">' . $ticket->ticket_status( TRUE ) . '</span>';
78
+				$ticket_status = '<span class="ticket-on-sale">'.$ticket->ticket_status(TRUE).'</span>';
79 79
 				$status_class = 'ticket-on-sale';
80 80
 			break;
81 81
 		}
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 		 *
91 91
 		 * @var string|bool
92 92
 		 */
93
-		if ( false !== ( $new_row_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_entire_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) {
93
+		if (false !== ($new_row_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_entire_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) {
94 94
 			echo $new_row_content;
95 95
 			continue;
96 96
 		}
97 97
 	?>
98
-				<tr class="tckt-slctr-tbl-tr <?php echo $status_class . ' ' . espresso_get_object_css_class( $ticket ); ?>">
98
+				<tr class="tckt-slctr-tbl-tr <?php echo $status_class.' '.espresso_get_object_css_class($ticket); ?>">
99 99
 		<?php
100 100
 		/**
101 101
 		 * Allow plugins to hook in and abort the generation and display of the contents of this
@@ -107,24 +107,24 @@  discard block
 block discarded – undo
107 107
 		 *
108 108
 		 * @var string|bool
109 109
 		 */
110
-		if ( false !== ( $new_row_cells_content = apply_filters( 'FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class ) ) ) {
110
+		if (false !== ($new_row_cells_content = apply_filters('FHEE__ticket_selector_chart_template__do_ticket_inside_row', false, $ticket, $max, $min, $required_ticket_sold_out, $ticket_price, $ticket_bundle, $ticket_status, $status_class))) {
111 111
 			echo $new_row_cells_content;
112 112
 			echo '</tr>';
113 113
 			continue;
114 114
 		}
115 115
 		?>
116 116
 					<td class="tckt-slctr-tbl-td-name">
117
-						<b><?php echo $ticket->get_pretty('TKT_name');?></b>
118
-						<?php if ( $template_settings->show_ticket_details ) : ?>
119
-							<a id="display-tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __( 'click to show additional ticket details', 'event_espresso' )) ); ?>">
120
-								<?php echo sprintf( __( 'show%1$sdetails%1$s+', 'event_espresso' ), '&nbsp;' ); ?>
117
+						<b><?php echo $ticket->get_pretty('TKT_name'); ?></b>
118
+						<?php if ($template_settings->show_ticket_details) : ?>
119
+							<a id="display-tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" class="display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__show_ticket_details_link_title', __('click to show additional ticket details', 'event_espresso'))); ?>">
120
+								<?php echo sprintf(__('show%1$sdetails%1$s+', 'event_espresso'), '&nbsp;'); ?>
121 121
 							</a>
122
-							<a id="hide-tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>" title="<?php echo esc_attr( apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __( 'click to hide additional ticket details', 'event_espresso' )) ); ?>" style="display:none;">
123
-								<?php echo sprintf( __( 'hide%1$sdetails%1$s-', 'event_espresso' ), '&nbsp;' ); ?>
122
+							<a id="hide-tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" class="hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js" rel="tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>" title="<?php echo esc_attr(apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', __('click to hide additional ticket details', 'event_espresso'))); ?>" style="display:none;">
123
+								<?php echo sprintf(__('hide%1$sdetails%1$s-', 'event_espresso'), '&nbsp;'); ?>
124 124
 							</a>
125 125
 						<?php endif; //end show details check ?>
126
-					<?php if ( $ticket->required() ) { ?>
127
-						<p class="ticket-required-pg"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_required_message', __( 'This ticket is required and must be purchased.', 'event_espresso' )); ?></p>
126
+					<?php if ($ticket->required()) { ?>
127
+						<p class="ticket-required-pg"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_required_message', __('This ticket is required and must be purchased.', 'event_espresso')); ?></p>
128 128
 					<?php } ?>
129 129
 					<?php
130 130
 //	echo '<br/><b>$max_atndz : ' . $max_atndz . '</b>';
@@ -138,63 +138,63 @@  discard block
 block discarded – undo
138 138
 //	echo '<br/><b> $ticket->required() : ' .  $ticket->uses() . '</b>';
139 139
 					?>
140 140
 					</td>
141
-					<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?>
142
-					<td class="tckt-slctr-tbl-td-price jst-rght"><?php echo EEH_Template::format_currency( $ticket_price ); ?>&nbsp;<span class="smaller-text no-bold"><?php
143
-						if ( $ticket_bundle ) {
144
-							echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __( ' / bundle', 'event_espresso' ));
141
+					<?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
142
+					<td class="tckt-slctr-tbl-td-price jst-rght"><?php echo EEH_Template::format_currency($ticket_price); ?>&nbsp;<span class="smaller-text no-bold"><?php
143
+						if ($ticket_bundle) {
144
+							echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_bundle_text', __(' / bundle', 'event_espresso'));
145 145
 						} else {
146
-							echo apply_filters( 'FHEE__ticket_selector_chart_template__per_ticket_text', __( '', 'event_espresso' ));
146
+							echo apply_filters('FHEE__ticket_selector_chart_template__per_ticket_text', __('', 'event_espresso'));
147 147
 						}?></span>&nbsp;</td>
148 148
 					<?php } ?>
149 149
 					<td class="tckt-slctr-tbl-td-qty cntr">
150 150
 					<?php
151 151
 					$hidden_input_qty = $max_atndz > 1 ? TRUE : FALSE;
152 152
 					// sold out or other status ?
153
-					if ( $tkt_status == EE_Ticket::sold_out || $remaining == 0 ) {
153
+					if ($tkt_status == EE_Ticket::sold_out || $remaining == 0) {
154 154
 					?>
155
-						<span class="sold-out"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __( 'Sold&nbsp;Out', 'event_espresso' ));?></span>
155
+						<span class="sold-out"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_sold_out_msg', __('Sold&nbsp;Out', 'event_espresso')); ?></span>
156 156
 					<?php
157
-					} else if ( $tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived ) {
157
+					} else if ($tkt_status == EE_Ticket::expired || $tkt_status == EE_Ticket::archived) {
158 158
 						echo $ticket_status;
159
-					} else if ( $tkt_status == EE_Ticket::pending ) {
159
+					} else if ($tkt_status == EE_Ticket::pending) {
160 160
 					?>
161 161
 					<div class="ticket-pending-pg">
162
-						<span class="ticket-pending"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __( 'Goes&nbsp;On&nbsp;Sale', 'event_espresso' )); ?></span><br/>
163
-						<span class="small-text"><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', apply_filters( 'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', $date_format ) ); ?></span>
162
+						<span class="ticket-pending"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg', __('Goes&nbsp;On&nbsp;Sale', 'event_espresso')); ?></span><br/>
163
+						<span class="small-text"><?php echo $ticket->get_i18n_datetime('TKT_start_date', apply_filters('FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format', $date_format)); ?></span>
164 164
 					</div>
165 165
 					<?php
166 166
 					// min qty purchasable is less than tickets available
167
-					} else if ( $ticket->min() > $remaining ) {
167
+					} else if ($ticket->min() > $remaining) {
168 168
 					?>
169 169
 					<div class="archived-ticket-pg">
170
-						<span class="archived-ticket small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_not_available_msg', __( 'Not Available', 'event_espresso' )); ?></span><br/>
170
+						<span class="archived-ticket small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_not_available_msg', __('Not Available', 'event_espresso')); ?></span><br/>
171 171
 					</div>
172 172
 					<?php
173 173
 					// if only one attendee is allowed to register at a time
174
-					} else if ( $max_atndz  == 1 ) {
174
+					} else if ($max_atndz == 1) {
175 175
 						// display submit button since we have tickets available
176
-						add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' );
176
+						add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
177 177
 				?>
178
-					<input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row . '-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?>  title=""/>
178
+					<input type="radio" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" value="<?php echo $row.'-'; ?>1" <?php echo $row == 1 ? ' checked="checked"' : ''; ?>  title=""/>
179 179
 			<?php
180 180
 						$hidden_input_qty = FALSE;
181 181
 
182
-					} else if ( $max_atndz  == 0 ) {
183
-						echo '<span class="sold-out">' . apply_filters( 'FHEE__ticket_selector_chart_template__ticket_closed_msg', __( 'Closed', 'event_espresso' )) . '</span>';
184
-					} elseif ( $max > 0 ) {
182
+					} else if ($max_atndz == 0) {
183
+						echo '<span class="sold-out">'.apply_filters('FHEE__ticket_selector_chart_template__ticket_closed_msg', __('Closed', 'event_espresso')).'</span>';
184
+					} elseif ($max > 0) {
185 185
 						// display submit button since we have tickets available
186
-						add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true' );
186
+						add_filter('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', '__return_true');
187 187
 
188 188
 				?>
189
-					<select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" title="">
189
+					<select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID.'-'.$row; ?>" class="ticket-selector-tbl-qty-slct" title="">
190 190
 					<?php
191 191
 						// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
192
-						if ( ! $ticket->required() && $min !== 0 ) {
192
+						if ( ! $ticket->required() && $min !== 0) {
193 193
 					?>
194 194
 						<option value="0">&nbsp;0&nbsp;</option>
195 195
 					<?php }
196 196
 						// offer ticket quantities from the min to the max
197
-						for ( $i = $min; $i <= $max; $i++) {
197
+						for ($i = $min; $i <= $max; $i++) {
198 198
 					?>
199 199
 						<option value="<?php echo $i; ?>">&nbsp;<?php echo $i; ?>&nbsp;</option>
200 200
 					<?php } ?>
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
 					}
206 206
 					// depending on group reg we need to change the format for qty
207
-					if ( $hidden_input_qty ) {
207
+					if ($hidden_input_qty) {
208 208
 					?>
209 209
 					<input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="0" />
210 210
 					<?php
@@ -214,33 +214,33 @@  discard block
 block discarded – undo
214 214
 
215 215
 					</td>
216 216
 				</tr>
217
-				<?php if ( $template_settings->show_ticket_details ) : ?>
218
-					<tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class( $ticket, '', 'details' );?>">
217
+				<?php if ($template_settings->show_ticket_details) : ?>
218
+					<tr class="tckt-slctr-tkt-details-tr <?php echo espresso_get_object_css_class($ticket, '', 'details'); ?>">
219 219
 						<td class="tckt-slctr-tkt-details-td" colspan="3" >
220
-							<div id="tckt-slctr-tkt-details-<?php echo $EVT_ID . '-' . $TKT_ID; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;">
220
+							<div id="tckt-slctr-tkt-details-<?php echo $EVT_ID.'-'.$TKT_ID; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;">
221 221
 
222 222
 								<section class="tckt-slctr-tkt-details-sctn">
223
-									<h3><?php _e( 'Details', 'event_espresso' ); ?></h3>
223
+									<h3><?php _e('Details', 'event_espresso'); ?></h3>
224 224
 									<p><?php echo $ticket->description(); ?></p>
225 225
 
226
-									<?php if ( $ticket_price != 0 && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?>
226
+									<?php if ($ticket_price != 0 && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
227 227
 									<section class="tckt-slctr-tkt-price-sctn">
228
-										<h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __( 'Price', 'event_espresso' )); ?></h5>
228
+										<h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', __('Price', 'event_espresso')); ?></h5>
229 229
 										<div class="tckt-slctr-tkt-details-tbl-wrap-dv">
230 230
 											<table class="tckt-slctr-tkt-details-tbl">
231 231
 												<thead>
232 232
 													<tr>
233
-														<th class="ee-third-width"><span class="small-text"><?php _e( 'Name', 'event_espresso' ); ?></span></th>
234
-														<th class="jst-cntr"><span class="small-text"><?php _e( 'Description', 'event_espresso' ); ?></span></th>
235
-														<th class="ee-fourth-width jst-rght"><span class="small-text"><?php _e( 'Amount', 'event_espresso' ); ?></span></th>
233
+														<th class="ee-third-width"><span class="small-text"><?php _e('Name', 'event_espresso'); ?></span></th>
234
+														<th class="jst-cntr"><span class="small-text"><?php _e('Description', 'event_espresso'); ?></span></th>
235
+														<th class="ee-fourth-width jst-rght"><span class="small-text"><?php _e('Amount', 'event_espresso'); ?></span></th>
236 236
 													</tr>
237 237
 												</thead>
238 238
 												<tbody>
239
-										<?php if ( $ticket->base_price() instanceof EE_Price ) { ?>
239
+										<?php if ($ticket->base_price() instanceof EE_Price) { ?>
240 240
 													<tr>
241
-														<td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td>
242
-														<td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td>
243
-														<td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td>
241
+														<td data-th="<?php _e('Name', 'event_espresso'); ?>" class="small-text"><b><?php echo $ticket->base_price()->name(); ?></b></td>
242
+														<td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $ticket->base_price()->desc(); ?></td>
243
+														<td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td>
244 244
 													</tr>
245 245
 													<?php
246 246
 															$running_total = $ticket->base_price()->amount();
@@ -248,44 +248,44 @@  discard block
 block discarded – undo
248 248
 															$running_total = 0;
249 249
 														}
250 250
 														// now add price modifiers
251
-														foreach ( $ticket->price_modifiers() as $price_mod ) { ?>
251
+														foreach ($ticket->price_modifiers() as $price_mod) { ?>
252 252
 													<tr>
253
-														<td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td>
254
-													<?php if ( $price_mod->is_percent() ) { ?>
255
-														<td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td>
253
+														<td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $price_mod->name(); ?></td>
254
+													<?php if ($price_mod->is_percent()) { ?>
255
+														<td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?> <?php echo $price_mod->amount(); ?>%</td>
256 256
 														<?php
257
-															$new_sub_total = $running_total * ( $price_mod->amount() / 100 );
257
+															$new_sub_total = $running_total * ($price_mod->amount() / 100);
258 258
 															$new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total;
259 259
 														?>
260 260
 													<?php } else { ?>
261 261
 														<?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?>
262
-														<td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td>
262
+														<td data-th="<?php _e('Description', 'event_espresso'); ?>" class="small-text"><?php echo $price_mod->desc(); ?></td>
263 263
 														<?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1 : $price_mod->amount(); ?>
264 264
 													<?php } ?>
265
-														<td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $new_sub_total ); ?></td>
265
+														<td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td>
266 266
 														<?php $running_total += $new_sub_total; ?>
267 267
 													</tr>
268 268
 												<?php } ?>
269
-												<?php if ( $ticket->taxable() ) { ?>
269
+												<?php if ($ticket->taxable()) { ?>
270 270
 													<?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?>
271 271
 													<tr>
272
-														<td colspan="2" class="jst-rght small-text sbttl"><b><?php _e( 'subtotal', 'event_espresso' ); ?></b></td>
273
-														<td data-th="<?php _e( 'subtotal', 'event_espresso' ); ?>" class="jst-rght small-text"><b><?php echo  EEH_Template::format_currency( $running_total ); ?></b></td>
272
+														<td colspan="2" class="jst-rght small-text sbttl"><b><?php _e('subtotal', 'event_espresso'); ?></b></td>
273
+														<td data-th="<?php _e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text"><b><?php echo  EEH_Template::format_currency($running_total); ?></b></td>
274 274
 													</tr>
275 275
 
276
-													<?php foreach ( $ticket->get_ticket_taxes_for_admin() as $tax ) { ?>
276
+													<?php foreach ($ticket->get_ticket_taxes_for_admin() as $tax) { ?>
277 277
 													<tr>
278
-														<td data-th="<?php _e( 'Name', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td>
279
-														<td data-th="<?php _e( 'Description', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td>
280
-														<?php $tax_amount = $running_total * ( $tax->amount() / 100 ); ?>
281
-														<td data-th="<?php _e( 'Amount', 'event_espresso' ); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency( $tax_amount ); ?></td>
278
+														<td data-th="<?php _e('Name', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->name(); ?></td>
279
+														<td data-th="<?php _e('Description', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo $tax->amount(); ?>%</td>
280
+														<?php $tax_amount = $running_total * ($tax->amount() / 100); ?>
281
+														<td data-th="<?php _e('Amount', 'event_espresso'); ?>" class="jst-rght small-text"><?php echo EEH_Template::format_currency($tax_amount); ?></td>
282 282
 														<?php $running_total += $tax_amount; ?>
283 283
 													</tr>
284 284
 													<?php } ?>
285 285
 												<?php } ?>
286 286
 													<tr>
287
-														<td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total', 'event_espresso' )); ?></b></td>
288
-														<td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_total_price', __( 'Total', 'event_espresso' )); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency( $running_total ); ?></b></td>
287
+														<td colspan="2" class="jst-rght small-text ttl-lbl-td"><b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total', 'event_espresso')); ?></b></td>
288
+														<td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price', __('Total', 'event_espresso')); ?>" class="jst-rght small-text"><b><?php echo EEH_Template::format_currency($running_total); ?></b></td>
289 289
 													</tr>
290 290
 												</tbody>
291 291
 											</table>
@@ -295,106 +295,106 @@  discard block
 block discarded – undo
295 295
 									<?php } ?>
296 296
 
297 297
 									<section class="tckt-slctr-tkt-sale-dates-sctn">
298
-										<h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __( 'Sale Dates', 'event_espresso' )); ?></h5>
299
-										<span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __( 'The dates when this option is available for purchase.', 'event_espresso' )); ?></span><br/>
300
-										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __( 'Goes On Sale:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime( 'TKT_start_date', $date_format) . ' &nbsp; '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime( 'TKT_start_date',  $time_format ) ; ?><br/>
301
-										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_sales_end', __( 'Sales End:', 'event_espresso' )); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime( 'TKT_end_date', $date_format ) . ' &nbsp; '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime( 'TKT_end_date', $time_format ) ; ?><br/>
298
+										<h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading', __('Sale Dates', 'event_espresso')); ?></h5>
299
+										<span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_dates_available_message', __('The dates when this option is available for purchase.', 'event_espresso')); ?></span><br/>
300
+										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale', __('Goes On Sale:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' &nbsp; '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?><br/>
301
+										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_sales_end', __('Sales End:', 'event_espresso')); ?></span><span class="dashicons dashicons-calendar"></span><?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' &nbsp; '; ?><span class="dashicons dashicons-clock"></span><?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?><br/>
302 302
 									</section>
303 303
 									<br/>
304 304
 
305
-									<?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?>
305
+									<?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?>
306 306
 
307
-									<?php if ( $ticket->min() &&$ticket->max() ) { ?>
307
+									<?php if ($ticket->min() && $ticket->max()) { ?>
308 308
 									<section class="tckt-slctr-tkt-quantities-sctn">
309
-										<h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __( 'Purchasable Quantities', 'event_espresso' )); ?></h5>
310
-										<span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __( 'The number of tickets that can be purchased per transaction (if available).', 'event_espresso' )); ?></span><br/>
311
-										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __( 'Minimum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
312
-										<?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span class="important-notice small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __( 'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso' )); ?></span><?php } ?><br/>
309
+										<h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading', __('Purchasable Quantities', 'event_espresso')); ?></h5>
310
+										<span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message', __('The number of tickets that can be purchased per transaction (if available).', 'event_espresso')); ?></span><br/>
311
+										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty', __('Minimum Qty:', 'event_espresso')); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
312
+										<?php if ($ticket->min() > $remaining) { ?> &nbsp; <span class="important-notice small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message', __('The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining', 'event_espresso')); ?></span><?php } ?><br/>
313 313
 										<?php //$max = min( $max, $max_atndz );?>
314
-										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __( 'Maximum Qty:', 'event_espresso' )); ?></span><?php echo $ticket->max() === EE_INF ? __( 'no limit', 'event_espresso' ) : max( $ticket->max(), 1 ); ?><br/>
314
+										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty', __('Maximum Qty:', 'event_espresso')); ?></span><?php echo $ticket->max() === EE_INF ? __('no limit', 'event_espresso') : max($ticket->max(), 1); ?><br/>
315 315
 									</section>
316 316
 									<br/>
317 317
 									<?php } ?>
318 318
 
319
-									<?php if ( $ticket->uses() !== EE_INF && ( ! defined( 'EE_DECAF' ) || EE_DECAF !== TRUE )) { ?>
319
+									<?php if ($ticket->uses() !== EE_INF && ( ! defined('EE_DECAF') || EE_DECAF !== TRUE)) { ?>
320 320
 									<section class="tckt-slctr-tkt-uses-sctn">
321
-										<h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __( 'Event Date Ticket Uses', 'event_espresso' )); ?></h5>
321
+										<h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading', __('Event Date Ticket Uses', 'event_espresso')); ?></h5>
322 322
 										<span class="drk-grey-text small-text no-bold"> - <?php
323 323
 											echo apply_filters(
324 324
 												'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
325 325
 												sprintf(
326
-													__( 'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso' ),
326
+													__('The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s', 'event_espresso'),
327 327
 													'<br/>',
328 328
 													'<strong>',
329 329
 													'</strong>'
330 330
 												)
331 331
 											);
332 332
 											?></span><br/>
333
-										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __( '# Datetimes:', 'event_espresso' )); ?></span><?php  echo $ticket->uses();?><br/>
333
+										<span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes', __('# Datetimes:', 'event_espresso')); ?></span><?php  echo $ticket->uses(); ?><br/>
334 334
 									</section>
335 335
 									<?php } ?>
336 336
 
337 337
 									<?php
338
-									$datetimes = $ticket->datetimes_ordered( $event_is_expired, FALSE );
338
+									$datetimes = $ticket->datetimes_ordered($event_is_expired, FALSE);
339 339
 									$chart_column_width = $template_settings->show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
340
-									if ( ! empty( $datetimes )) { ?>
340
+									if ( ! empty($datetimes)) { ?>
341 341
 									<section class="tckt-slctr-tkt-datetimes-sctn">
342
-										<h5><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __( 'Access', 'event_espresso' )); ?></h5>
343
-										<span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __( 'This option allows access to the following dates and times.', 'event_espresso' )); ?></span>
342
+										<h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_heading', __('Access', 'event_espresso')); ?></h5>
343
+										<span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_message', __('This option allows access to the following dates and times.', 'event_espresso')); ?></span>
344 344
 										<div class="tckt-slctr-tkt-details-tbl-wrap-dv">
345 345
 											<table class="tckt-slctr-tkt-details-tbl">
346 346
 												<thead>
347 347
 													<tr>
348 348
 														<th class="tckt-slctr-tkt-details-date-th">
349
-															<span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Date ', 'event_espresso' )); ?></span>
349
+															<span class="dashicons dashicons-calendar"></span><span class="small-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Date ', 'event_espresso')); ?></span>
350 350
 														</th>
351 351
 														<th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
352
-															<span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e( 'Time ', 'event_espresso' ); ?></span>
352
+															<span class="dashicons dashicons-clock"></span><span class="small-text"><?php _e('Time ', 'event_espresso'); ?></span>
353 353
 														</th>
354
-														<?php if ( $template_settings->show_ticket_sale_columns ) : ?>
354
+														<?php if ($template_settings->show_ticket_sale_columns) : ?>
355 355
 															<th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
356
-																<span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf( __( 'Sold', 'event_espresso' ), '<br/>' )); ?></span>
356
+																<span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', sprintf(__('Sold', 'event_espresso'), '<br/>')); ?></span>
357 357
 															</th>
358 358
 															<th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
359
-																<span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf( __( 'Remaining', 'event_espresso' ), '<br/>' )); ?></span>
359
+																<span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', sprintf(__('Remaining', 'event_espresso'), '<br/>')); ?></span>
360 360
 															</th>
361 361
 															<th class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
362
-																<span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf( __( 'Total%sSold', 'event_espresso' ), '<br/>' )); ?></span>
362
+																<span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', sprintf(__('Total%sSold', 'event_espresso'), '<br/>')); ?></span>
363 363
 															</th>
364 364
 															<th class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
365
-																<span class="smaller-text"><?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf( __( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )); ?></span>
365
+																<span class="smaller-text"><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', sprintf(__('Total Spaces%sLeft', 'event_espresso'), '<br/>')); ?></span>
366 366
 															</th>
367 367
 														<?php endif; //end $template_settings->show_ticket_sale_columns conditional ?>
368 368
 													</tr>
369 369
 												</thead>
370 370
 												<tbody>
371 371
 											<?php
372
-												foreach ( $datetimes as $datetime ) {
373
-													if ( $datetime instanceof EE_Datetime ) {
372
+												foreach ($datetimes as $datetime) {
373
+													if ($datetime instanceof EE_Datetime) {
374 374
 											?>
375 375
 
376 376
 												<tr>
377
-													<td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __( 'Event Date ', 'event_espresso' )); ?>" class="small-text">
377
+													<td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date', __('Event Date ', 'event_espresso')); ?>" class="small-text">
378 378
 														<?php $datetime_name = $datetime->name(); ?>
379
-														<?php echo ! empty( $datetime_name ) ? '<b>' . $datetime_name . '</b><br/>' : ''; ?>
380
-														<?php echo $datetime->date_range( $date_format, __( ' to  ', 'event_espresso' )); ?>
379
+														<?php echo ! empty($datetime_name) ? '<b>'.$datetime_name.'</b><br/>' : ''; ?>
380
+														<?php echo $datetime->date_range($date_format, __(' to  ', 'event_espresso')); ?>
381 381
 													</td>
382
-													<td data-th="<?php _e( 'Time ', 'event_espresso' ); ?>" class="cntr small-text">
383
-														<?php echo $datetime->time_range( $time_format, __( ' to  ', 'event_espresso' )); ?>
382
+													<td data-th="<?php _e('Time ', 'event_espresso'); ?>" class="cntr small-text">
383
+														<?php echo $datetime->time_range($time_format, __(' to  ', 'event_espresso')); ?>
384 384
 													</td>
385
-													<?php if ( $template_settings->show_ticket_sale_columns ) : ?>
386
-														<td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __( 'Sold', 'event_espresso' )); ?>" class="cntr small-text">
385
+													<?php if ($template_settings->show_ticket_sale_columns) : ?>
386
+														<td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold', __('Sold', 'event_espresso')); ?>" class="cntr small-text">
387 387
 															<?php echo $ticket->sold(); ?>
388 388
 														</td>
389
-														<td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __( 'Remaining', 'event_espresso' )); ?>" class="cntr small-text">
390
-															<?php echo $ticket->qty() === EE_INF ? '<span class="smaller-text">' .  __( 'unlimited ', 'event_espresso' ) . '</span>' : $ticket->qty() - $ticket->sold(); ?>
389
+														<td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left', __('Remaining', 'event_espresso')); ?>" class="cntr small-text">
390
+															<?php echo $ticket->qty() === EE_INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $ticket->qty() - $ticket->sold(); ?>
391 391
 														</td>
392
-														<td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __( 'Total Sold', 'event_espresso' )); ?>" class="cntr small-text">
392
+														<td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold', __('Total Sold', 'event_espresso')); ?>" class="cntr small-text">
393 393
 															<?php echo $datetime->sold(); ?>
394 394
 														</td>
395
-												<?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">' . __( 'Sold&nbsp;Out', 'event_espresso' ) . '</span>' : $datetime->spaces_remaining(); ?>
396
-														<td data-th="<?php echo apply_filters( 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __( 'Total Spaces Left', 'event_espresso' )); ?>" class="cntr small-text">
397
-															<?php echo $tkts_left === EE_INF ? '<span class="smaller-text">' .  __( 'unlimited ', 'event_espresso' ) . '</span>' : $tkts_left; ?>
395
+												<?php $tkts_left = $datetime->sold_out() ? '<span class="sold-out smaller-text">'.__('Sold&nbsp;Out', 'event_espresso').'</span>' : $datetime->spaces_remaining(); ?>
396
+														<td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left', __('Total Spaces Left', 'event_espresso')); ?>" class="cntr small-text">
397
+															<?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'.__('unlimited ', 'event_espresso').'</span>' : $tkts_left; ?>
398 398
 														</td>
399 399
 													<?php endif; //end $template_settings->show_ticket_sale_columns conditional ?>
400 400
 												</tr>
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 							</div>
413 413
 						</td>
414 414
 					</tr>
415
-				<?php endif;  //end template_settings->show_ticket_details check?>
415
+				<?php endif; //end template_settings->show_ticket_details check?>
416 416
 	<?php
417 417
 			$row++;
418 418
 		}
@@ -421,32 +421,32 @@  discard block
 block discarded – undo
421 421
 $ticket_row_html = ob_get_clean();
422 422
 // if there is only ONE ticket with a max qty of ONE, and it is free... then not much need for the ticket selector
423 423
 $hide_ticket_selector = $ticket_count == 1 && $max == 1 && $ticket->is_free() ? true : false;
424
-$hide_ticket_selector = apply_filters( 'FHEE__ticket_selector_chart_template__hide_ticket_selector', $hide_ticket_selector, $EVT_ID );
424
+$hide_ticket_selector = apply_filters('FHEE__ticket_selector_chart_template__hide_ticket_selector', $hide_ticket_selector, $EVT_ID);
425 425
 //EEH_Debug_Tools::printr( $ticket_count, '$ticket_count', __FILE__, __LINE__ );
426 426
 //EEH_Debug_Tools::printr( $max, '$max', __FILE__, __LINE__ );
427 427
 //EEH_Debug_Tools::printr( $hide_ticket_selector, '$hide_ticket_selector', __FILE__, __LINE__ );
428 428
 //EEH_Debug_Tools::printr( $table_style, '$table_style', __FILE__, __LINE__ );
429 429
 remove_filter(
430 430
 	'FHEE__EE_Ticket_Selector__after_ticket_selector_submit',
431
-	array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' )
431
+	array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv')
432 432
 );
433 433
 remove_filter(
434 434
 	'FHEE__EE_Ticket_Selector__after_view_details_btn',
435
-	array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' )
435
+	array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv')
436 436
 );
437
-if ( ! $hide_ticket_selector ) {
437
+if ( ! $hide_ticket_selector) {
438 438
 ?>
439 439
 <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv">
440 440
 
441
-	<?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?>
441
+	<?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?>
442 442
 
443 443
 	<table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl">
444 444
 		<thead>
445 445
 			<tr>
446 446
 				<th scope="col" class="ee-ticket-selector-ticket-details-th">
447
-					<?php echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_available_tickets', '', $EVT_ID ) ); ?>
447
+					<?php echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_available_tickets', '', $EVT_ID)); ?>
448 448
 				</th>
449
-				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE )) { ?>
449
+				<?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
450 450
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
451 451
 					<?php
452 452
 						/**
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 						 * @param string 'Price' The translatable text to display in the table header for price
458 458
 						 * @param int $EVT_ID The Event ID
459 459
 						 */
460
-						echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_price', __( 'Price', 'event_espresso' ), $EVT_ID ) );
460
+						echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_price', __('Price', 'event_espresso'), $EVT_ID));
461 461
 					?>
462 462
 				</th>
463 463
 				<?php } ?>
@@ -471,24 +471,24 @@  discard block
 block discarded – undo
471 471
 						* @param string 'Qty*' The translatable text to display in the table header for the Quantity of tickets
472 472
 						* @param int $EVT_ID The Event ID
473 473
 						*/
474
-						echo esc_html( apply_filters( 'FHEE__ticket_selector_chart_template__table_header_qty', __( 'Qty*', 'event_espresso' ), $EVT_ID ) );
474
+						echo esc_html(apply_filters('FHEE__ticket_selector_chart_template__table_header_qty', __('Qty*', 'event_espresso'), $EVT_ID));
475 475
 					?>
476 476
 				</th>
477 477
 			</tr>
478 478
 		</thead>
479 479
 		<tbody>
480
-			<?php echo $ticket_row_html;?>
480
+			<?php echo $ticket_row_html; ?>
481 481
 		</tbody>
482 482
 	</table>
483 483
 
484 484
 	<input type="hidden" name="noheader" value="true" />
485
-	<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url();?>" />
485
+	<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::filter_input_server_url(); ?>" />
486 486
 	<input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>" />
487 487
 	<input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" />
488 488
 	<input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" />
489 489
 
490 490
 <?php
491
-if ( $max_atndz > 0 && ! $hide_ticket_selector ) {
491
+if ($max_atndz > 0 && ! $hide_ticket_selector) {
492 492
 	echo apply_filters(
493 493
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
494 494
 		''
@@ -496,10 +496,10 @@  discard block
 block discarded – undo
496 496
 }
497 497
 ?>
498 498
 
499
-	<?php do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event ); ?>
499
+	<?php do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event); ?>
500 500
 
501 501
 </div>
502
-<?php } else if ( isset( $TKT_ID ) ) { ?>
502
+<?php } else if (isset($TKT_ID)) { ?>
503 503
 <input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="1"/>
504 504
 <input type="hidden" name="tkt-slctr-ticket-id-<?php echo $EVT_ID; ?>[]" value="<?php echo $TKT_ID; ?>"/>
505 505
 <input type="hidden" name="noheader" value="true"/>
@@ -508,27 +508,27 @@  discard block
 block discarded – undo
508 508
 <input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>"/>
509 509
 <input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>"/>
510 510
 <?php
511
-	if ( $ticket instanceof EE_Ticket ) {
512
-		do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event );
511
+	if ($ticket instanceof EE_Ticket) {
512
+		do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event);
513 513
 		$ticket_description = $ticket->description();
514 514
 ?>
515 515
 <div id="no-tkt-slctr-ticket-dv-<?php echo $EVT_ID; ?>" class="no-tkt-slctr-ticket-dv">
516 516
 	<div class="no-tkt-slctr-ticket-content-dv">
517 517
 		<h5><?php echo $ticket->name(); ?></h5>
518
-		<?php if ( ! empty( $ticket_description ) ) { ?>
518
+		<?php if ( ! empty($ticket_description)) { ?>
519 519
 		<p><?php echo $ticket_description; ?></p>
520 520
 		<?php } ?>
521 521
 	</div>
522 522
 <?php
523 523
 		add_filter(
524 524
 			'FHEE__EE_Ticket_Selector__after_ticket_selector_submit',
525
-			array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' )
525
+			array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv')
526 526
 		);
527 527
 		add_filter(
528 528
 			'FHEE__EE_Ticket_Selector__after_view_details_btn',
529
-			array( 'EED_Ticket_Selector', 'no_tkt_slctr_end_dv' )
529
+			array('EED_Ticket_Selector', 'no_tkt_slctr_end_dv')
530 530
 		);
531
-		do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event );
531
+		do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event);
532 532
 	}
533 533
 }
534 534
 ?>
Please login to merge, or discard this patch.