@@ -7,22 +7,22 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$label = empty( $label ) ? '' : wp_kses_post( $label ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->textarea( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | ) |
28 | 28 | ); |
@@ -7,22 +7,22 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$label = empty( $label ) ? '' : wp_kses_post( $label ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->input( |
19 | 19 | array( |
20 | 20 | 'type' => 'checkbox', |
21 | - 'name' => esc_attr( $id ), |
|
22 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
23 | - 'required' => ! empty( $required ), |
|
21 | + 'name' => esc_attr($id), |
|
22 | + 'id' => esc_attr($id) . uniqid('_'), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | - 'value' => esc_attr__( 'Yes', 'invoicing' ), |
|
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
25 | + 'value' => esc_attr__('Yes', 'invoicing'), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | ) |
28 | 28 | ); |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | global $wpi_invoice; |
3 | 3 | |
4 | 4 | // Backwards compatibility. |
5 | -if ( empty( $invoice ) ) { |
|
5 | +if (empty($invoice)) { |
|
6 | 6 | $invoice = $wpi_invoice; |
7 | 7 | } |
8 | 8 | |
9 | 9 | $success_page_uri = wpinv_get_success_page_uri(); |
10 | -if ( ! empty( $invoice ) ) { |
|
10 | +if (!empty($invoice)) { |
|
11 | 11 | $success_page_uri = $invoice->get_receipt_url(); |
12 | 12 | } |
13 | 13 | ?> |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | <?php |
18 | 18 | echo |
19 | 19 | wp_sprintf( |
20 | - __( 'Your payment is processing. This page will reload automatically in 10 seconds. If it does not, click <a href="%s">here</a>.', 'invoicing' ), |
|
21 | - esc_url( $success_page_uri ) |
|
20 | + __('Your payment is processing. This page will reload automatically in 10 seconds. If it does not, click <a href="%s">here</a>.', 'invoicing'), |
|
21 | + esc_url($success_page_uri) |
|
22 | 22 | ); |
23 | 23 | ?> |
24 | 24 | <i class="fa fa-spin fa-refresh"></i> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | <script type="text/javascript"> |
28 | 28 | setTimeout( |
29 | 29 | function(){ |
30 | - window.location = '<?php echo esc_url( $success_page_uri ); ?>'; |
|
30 | + window.location = '<?php echo esc_url($success_page_uri); ?>'; |
|
31 | 31 | }, |
32 | 32 | 10000 |
33 | 33 | ); |
@@ -7,14 +7,14 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div v-if='!is_default'> |
15 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here. Click to set items.', 'invoicing' ) ?></div> |
|
15 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here. Click to set items.', 'invoicing') ?></div> |
|
16 | 16 | </div> |
17 | 17 | |
18 | 18 | <div v-if='is_default'> |
19 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here.', 'invoicing' ) ?></div> |
|
19 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here.', 'invoicing') ?></div> |
|
20 | 20 | </div> |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Prepare the selectable items. |
13 | 13 | $selectable = array(); |
14 | -foreach ( $form->get_items() as $item ) { |
|
15 | - if ( ! $item->is_required ) { |
|
16 | - $selectable[$item->get_id()] = strip_tags( $item->get_name() . ' — ' . wpinv_price( wpinv_format_amount( $item->get_initial_price() ) ) ); |
|
14 | +foreach ($form->get_items() as $item) { |
|
15 | + if (!$item->is_required) { |
|
16 | + $selectable[$item->get_id()] = strip_tags($item->get_name() . ' — ' . wpinv_price(wpinv_format_amount($item->get_initial_price()))); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if ( empty( $selectable ) ) { |
|
20 | +if (empty($selectable)) { |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | echo aui()->select( |
28 | 28 | array( |
29 | 29 | 'name' => 'getpaid-payment-form-selected-item', |
30 | - 'id' => 'getpaid-payment-form-selected-item' . uniqid( '_' ), |
|
30 | + 'id' => 'getpaid-payment-form-selected-item' . uniqid('_'), |
|
31 | 31 | 'required' => true, |
32 | - 'label' => __( 'Select Item', 'invoicing' ), |
|
32 | + 'label' => __('Select Item', 'invoicing'), |
|
33 | 33 | 'label_type' => 'vertical', |
34 | 34 | 'inline' => false, |
35 | 35 | 'options' => $selectable, |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if (!defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @param string $context View or edit context. |
88 | 88 | * @return string |
89 | 89 | */ |
90 | - public function get_name( $context = 'view' ) { |
|
91 | - $name = parent::get_name( $context ); |
|
92 | - return $name . wpinv_get_item_suffix( $this ); |
|
90 | + public function get_name($context = 'view') { |
|
91 | + $name = parent::get_name($context); |
|
92 | + return $name . wpinv_get_item_suffix($this); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | * @param string $context View or edit context. |
100 | 100 | * @return string |
101 | 101 | */ |
102 | - public function get_raw_name( $context = 'view' ) { |
|
103 | - return parent::get_name( $context ); |
|
102 | + public function get_raw_name($context = 'view') { |
|
103 | + return parent::get_name($context); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | * @param string $context View or edit context. |
111 | 111 | * @return string |
112 | 112 | */ |
113 | - public function get_description( $context = 'view' ) { |
|
113 | + public function get_description($context = 'view') { |
|
114 | 114 | |
115 | - if ( isset( $this->custom_description ) ) { |
|
115 | + if (isset($this->custom_description)) { |
|
116 | 116 | return $this->custom_description; |
117 | 117 | } |
118 | 118 | |
119 | - return parent::get_description( $context ); |
|
119 | + return parent::get_description($context); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | * @param string $context View or edit context. |
127 | 127 | * @return float |
128 | 128 | */ |
129 | - public function get_sub_total( $context = 'view' ) { |
|
130 | - return $this->get_quantity( $context ) * $this->get_initial_price( $context ); |
|
129 | + public function get_sub_total($context = 'view') { |
|
130 | + return $this->get_quantity($context) * $this->get_initial_price($context); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | * @param string $context View or edit context. |
138 | 138 | * @return float |
139 | 139 | */ |
140 | - public function get_recurring_sub_total( $context = 'view' ) { |
|
140 | + public function get_recurring_sub_total($context = 'view') { |
|
141 | 141 | |
142 | - if ( $this->is_recurring() ) { |
|
143 | - return $this->get_quantity( $context ) * $this->get_price( $context ); |
|
142 | + if ($this->is_recurring()) { |
|
143 | + return $this->get_quantity($context) * $this->get_price($context); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return 0; |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | /** |
150 | 150 | * @deprecated |
151 | 151 | */ |
152 | - public function get_qantity( $context = 'view' ) { |
|
153 | - return $this->get_quantity( $context ); |
|
152 | + public function get_qantity($context = 'view') { |
|
153 | + return $this->get_quantity($context); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -160,15 +160,15 @@ discard block |
||
160 | 160 | * @param string $context View or edit context. |
161 | 161 | * @return int |
162 | 162 | */ |
163 | - public function get_quantity( $context = 'view' ) { |
|
163 | + public function get_quantity($context = 'view') { |
|
164 | 164 | $quantity = (int) $this->quantity; |
165 | 165 | |
166 | - if ( empty( $quantity ) || 1 > $quantity ) { |
|
166 | + if (empty($quantity) || 1 > $quantity) { |
|
167 | 167 | $quantity = 1; |
168 | 168 | } |
169 | 169 | |
170 | - if ( 'view' == $context ) { |
|
171 | - return apply_filters( 'getpaid_payment_form_item_quantity', $quantity, $this ); |
|
170 | + if ('view' == $context) { |
|
171 | + return apply_filters('getpaid_payment_form_item_quantity', $quantity, $this); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | return $quantity; |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | * @param string $context View or edit context. |
183 | 183 | * @return meta |
184 | 184 | */ |
185 | - public function get_item_meta( $context = 'view' ) { |
|
185 | + public function get_item_meta($context = 'view') { |
|
186 | 186 | $meta = $this->meta; |
187 | 187 | |
188 | - if ( 'view' == $context ) { |
|
189 | - return apply_filters( 'getpaid_payment_form_item_meta', $meta, $this ); |
|
188 | + if ('view' == $context) { |
|
189 | + return apply_filters('getpaid_payment_form_item_meta', $meta, $this); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | return $meta; |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | * @param string $context View or edit context. |
201 | 201 | * @return bool |
202 | 202 | */ |
203 | - public function get_allow_quantities( $context = 'view' ) { |
|
203 | + public function get_allow_quantities($context = 'view') { |
|
204 | 204 | $allow_quantities = (bool) $this->allow_quantities; |
205 | 205 | |
206 | - if ( 'view' == $context ) { |
|
207 | - return apply_filters( 'getpaid_payment_form_item_allow_quantities', $allow_quantities, $this ); |
|
206 | + if ('view' == $context) { |
|
207 | + return apply_filters('getpaid_payment_form_item_allow_quantities', $allow_quantities, $this); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | return $allow_quantities; |
@@ -218,11 +218,11 @@ discard block |
||
218 | 218 | * @param string $context View or edit context. |
219 | 219 | * @return bool |
220 | 220 | */ |
221 | - public function get_is_required( $context = 'view' ) { |
|
221 | + public function get_is_required($context = 'view') { |
|
222 | 222 | $is_required = (bool) $this->is_required; |
223 | 223 | |
224 | - if ( 'view' == $context ) { |
|
225 | - return apply_filters( 'getpaid_payment_form_item_is_required', $is_required, $this ); |
|
224 | + if ('view' == $context) { |
|
225 | + return apply_filters('getpaid_payment_form_item_is_required', $is_required, $this); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | return $is_required; |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | * @since 1.0.19 |
236 | 236 | * @return array |
237 | 237 | */ |
238 | - public function prepare_data_for_use( $required = null ) { |
|
238 | + public function prepare_data_for_use($required = null) { |
|
239 | 239 | |
240 | - $required = is_null( $required ) ? $this->is_required() : $required; |
|
240 | + $required = is_null($required) ? $this->is_required() : $required; |
|
241 | 241 | return array( |
242 | - 'title' => strip_tags( $this->get_name() ), |
|
242 | + 'title' => strip_tags($this->get_name()), |
|
243 | 243 | 'id' => $this->get_id(), |
244 | 244 | 'price' => $this->get_price(), |
245 | 245 | 'recurring' => $this->is_recurring(), |
@@ -256,28 +256,28 @@ discard block |
||
256 | 256 | * @since 1.0.19 |
257 | 257 | * @return array |
258 | 258 | */ |
259 | - public function prepare_data_for_invoice_edit_ajax( $currency = '' ) { |
|
259 | + public function prepare_data_for_invoice_edit_ajax($currency = '') { |
|
260 | 260 | |
261 | - $description = getpaid_item_recurring_price_help_text( $this, $currency ); |
|
261 | + $description = getpaid_item_recurring_price_help_text($this, $currency); |
|
262 | 262 | |
263 | - if ( $description ) { |
|
263 | + if ($description) { |
|
264 | 264 | $description = "<div class='getpaid-subscription-help-text'>$description</div>"; |
265 | 265 | } |
266 | 266 | |
267 | 267 | return array( |
268 | 268 | 'id' => $this->get_id(), |
269 | 269 | 'texts' => array( |
270 | - 'item-name' => sanitize_text_field( $this->get_name() ), |
|
271 | - 'item-description' => wp_kses_post( $this->get_description() ) . $description, |
|
272 | - 'item-quantity' => absint( $this->get_quantity() ), |
|
273 | - 'item-price' => wpinv_price( wpinv_format_amount ( $this->get_price() ), $currency ), |
|
274 | - 'item-total' => wpinv_price( wpinv_format_amount( $this->get_sub_total() ), $currency ), |
|
270 | + 'item-name' => sanitize_text_field($this->get_name()), |
|
271 | + 'item-description' => wp_kses_post($this->get_description()) . $description, |
|
272 | + 'item-quantity' => absint($this->get_quantity()), |
|
273 | + 'item-price' => wpinv_price(wpinv_format_amount($this->get_price()), $currency), |
|
274 | + 'item-total' => wpinv_price(wpinv_format_amount($this->get_sub_total()), $currency), |
|
275 | 275 | ), |
276 | 276 | 'inputs' => array( |
277 | 277 | 'item-id' => $this->get_id(), |
278 | - 'item-name' => sanitize_text_field( $this->get_name() ), |
|
279 | - 'item-description' => wp_kses_post( $this->get_description() ), |
|
280 | - 'item-quantity' => absint( $this->get_quantity() ), |
|
278 | + 'item-name' => sanitize_text_field($this->get_name()), |
|
279 | + 'item-description' => wp_kses_post($this->get_description()), |
|
280 | + 'item-quantity' => absint($this->get_quantity()), |
|
281 | 281 | 'item-price' => $this->get_price(), |
282 | 282 | ) |
283 | 283 | ); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | return array( |
296 | 296 | 'post_id' => $this->invoice_id, |
297 | 297 | 'item_id' => $this->get_id(), |
298 | - 'item_name' => sanitize_text_field( $this->get_raw_name() ), |
|
298 | + 'item_name' => sanitize_text_field($this->get_raw_name()), |
|
299 | 299 | 'item_description' => $this->get_description(), |
300 | 300 | 'tax' => $this->item_tax, |
301 | 301 | 'item_price' => $this->get_price(), |
@@ -324,9 +324,9 @@ discard block |
||
324 | 324 | * @since 1.0.19 |
325 | 325 | * @param int $quantity The item quantity. |
326 | 326 | */ |
327 | - public function set_quantity( $quantity ) { |
|
327 | + public function set_quantity($quantity) { |
|
328 | 328 | |
329 | - if ( empty( $quantity ) || ! is_numeric( $quantity ) ) { |
|
329 | + if (empty($quantity) || !is_numeric($quantity)) { |
|
330 | 330 | $quantity = 1; |
331 | 331 | } |
332 | 332 | |
@@ -340,8 +340,8 @@ discard block |
||
340 | 340 | * @since 1.0.19 |
341 | 341 | * @param array $meta The item meta data. |
342 | 342 | */ |
343 | - public function set_item_meta( $meta ) { |
|
344 | - $this->meta = maybe_unserialize( $meta ); |
|
343 | + public function set_item_meta($meta) { |
|
344 | + $this->meta = maybe_unserialize($meta); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * @since 1.0.19 |
351 | 351 | * @param bool $allow_quantities |
352 | 352 | */ |
353 | - public function set_allow_quantities( $allow_quantities ) { |
|
353 | + public function set_allow_quantities($allow_quantities) { |
|
354 | 354 | $this->allow_quantities = (bool) $allow_quantities; |
355 | 355 | } |
356 | 356 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | * @since 1.0.19 |
361 | 361 | * @param bool $is_required |
362 | 362 | */ |
363 | - public function set_is_required( $is_required ) { |
|
363 | + public function set_is_required($is_required) { |
|
364 | 364 | $this->is_required = (bool) $is_required; |
365 | 365 | } |
366 | 366 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | * @since 1.0.19 |
371 | 371 | * @param string $description |
372 | 372 | */ |
373 | - public function set_custom_description( $description ) { |
|
373 | + public function set_custom_description($description) { |
|
374 | 374 | $this->custom_description = $description; |
375 | 375 | } |
376 | 376 | |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | * |
380 | 380 | * @return int item id |
381 | 381 | */ |
382 | - public function save( $data = array() ) { |
|
382 | + public function save($data = array()) { |
|
383 | 383 | return $this->get_id(); |
384 | 384 | } |
385 | 385 |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | * @var array $fee |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | -do_action( 'getpaid_before_invoice_fee_item', $invoice, $fee ); |
|
14 | +do_action('getpaid_before_invoice_fee_item', $invoice, $fee); |
|
15 | 15 | |
16 | 16 | ?> |
17 | 17 | |
@@ -19,61 +19,61 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="form-row"> |
21 | 21 | |
22 | - <?php foreach ( array_keys( $columns ) as $column ): ?> |
|
22 | + <?php foreach (array_keys($columns) as $column): ?> |
|
23 | 23 | |
24 | - <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class( $column ); ?>"> |
|
24 | + <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class($column); ?>"> |
|
25 | 25 | |
26 | 26 | <?php |
27 | 27 | |
28 | 28 | // Fires before printing a fee item column. |
29 | - do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice ); |
|
29 | + do_action("getpaid_invoice_fee_item_before_$column", $fee, $invoice); |
|
30 | 30 | |
31 | 31 | // Item name. |
32 | - if ( 'name' == $column ) { |
|
32 | + if ('name' == $column) { |
|
33 | 33 | |
34 | 34 | // Display the name. |
35 | - echo '<div class="mb-1">' . sanitize_text_field( $fee['name'] ) . '</div>'; |
|
35 | + echo '<div class="mb-1">' . sanitize_text_field($fee['name']) . '</div>'; |
|
36 | 36 | |
37 | 37 | // And an optional description. |
38 | - $description = esc_html__( 'Fee', 'invoicing' ); |
|
38 | + $description = esc_html__('Fee', 'invoicing'); |
|
39 | 39 | echo "<small class='form-text text-muted pr-2 m-0'>$description</small>"; |
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Item price. |
44 | - if ( 'price' == $column ) { |
|
44 | + if ('price' == $column) { |
|
45 | 45 | |
46 | 46 | // Display the item price (or recurring price if this is a renewal invoice) |
47 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
48 | - echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
47 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
48 | + echo wpinv_price($fee['recurring_fee'], $invoice->get_currency()); |
|
49 | 49 | } else { |
50 | - echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
50 | + echo wpinv_price($fee['initial_fee'], $invoice->get_currency()); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
54 | 54 | |
55 | 55 | // Item quantity. |
56 | - if ( 'quantity' == $column ) { |
|
56 | + if ('quantity' == $column) { |
|
57 | 57 | echo "—"; |
58 | 58 | } |
59 | 59 | |
60 | 60 | // Item sub total. |
61 | - if ( 'subtotal' == $column ) { |
|
61 | + if ('subtotal' == $column) { |
|
62 | 62 | |
63 | 63 | // Display the item price (or recurring price if this is a renewal invoice) |
64 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
65 | - echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
64 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
65 | + echo wpinv_price($fee['recurring_fee'], $invoice->get_currency()); |
|
66 | 66 | } else { |
67 | - echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
67 | + echo wpinv_price($fee['initial_fee'], $invoice->get_currency()); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | } |
71 | 71 | |
72 | 72 | // Fires when printing a fee item column. |
73 | - do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice ); |
|
73 | + do_action("getpaid_invoice_fee_item_$column", $fee, $invoice); |
|
74 | 74 | |
75 | 75 | // Fires after printing a fee item column. |
76 | - do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice ); |
|
76 | + do_action("getpaid_invoice_fee_item_after_$column", $fee, $invoice); |
|
77 | 77 | |
78 | 78 | ?> |
79 | 79 |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | * @var WPInv_Invoice $invoice |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | -<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
15 | +<?php do_action('getpaid_invoice_before_line_items', $invoice); ?> |
|
16 | 16 | |
17 | - <h2 class="mt-5 mb-1 h4"><?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), ucfirst( $invoice->get_type() )); ?></h2> |
|
17 | + <h2 class="mt-5 mb-1 h4"><?php echo sprintf(esc_html__('%s Items', 'invoicing'), ucfirst($invoice->get_type())); ?></h2> |
|
18 | 18 | <div class="getpaid-invoice-items mb-4 border"> |
19 | 19 | |
20 | 20 | |
21 | - <div class="getpaid-invoice-items-header <?php echo sanitize_html_class( $invoice->get_template() ); ?>"> |
|
21 | + <div class="getpaid-invoice-items-header <?php echo sanitize_html_class($invoice->get_template()); ?>"> |
|
22 | 22 | <div class="form-row"> |
23 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
24 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>"> |
|
25 | - <?php echo sanitize_text_field( $label ); ?> |
|
23 | + <?php foreach ($columns as $key => $label) : ?> |
|
24 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-line-item-col-<?php echo esc_attr($key); ?>"> |
|
25 | + <?php echo sanitize_text_field($label); ?> |
|
26 | 26 | </div> |
27 | 27 | <?php endforeach; ?> |
28 | 28 | </div> |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | <?php |
33 | 33 | |
34 | 34 | // Display the item totals. |
35 | - foreach ( $invoice->get_items() as $item ) { |
|
36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
35 | + foreach ($invoice->get_items() as $item) { |
|
36 | + wpinv_get_template('invoice/line-item.php', compact('invoice', 'item', 'columns')); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Display the fee totals. |
40 | - foreach ( $invoice->get_fees() as $fee ) { |
|
41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
40 | + foreach ($invoice->get_fees() as $fee) { |
|
41 | + wpinv_get_template('invoice/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // Display the cart totals. |
45 | - wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
45 | + wpinv_get_template('invoice/line-totals.php', compact('invoice')); |
|
46 | 46 | |
47 | 47 | ?> |
48 | 48 | |
49 | 49 | </div> |
50 | 50 | |
51 | -<?php do_action( 'getpaid_invoice_after_line_items', $invoice ); ?> |
|
51 | +<?php do_action('getpaid_invoice_after_line_items', $invoice); ?> |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | <h2 class="h3 text-dark"> |
14 | - <?php echo apply_filters( 'getpaid_invoice_type_label', ucfirst( $invoice->get_type() ), $invoice ); ?> |
|
14 | + <?php echo apply_filters('getpaid_invoice_type_label', ucfirst($invoice->get_type()), $invoice); ?> |
|
15 | 15 | </h2> |
16 | 16 | |
17 | 17 | <?php |