@@ -22,15 +22,15 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | switch( $items_type ) { |
25 | - case 'radio': |
|
26 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
27 | - break; |
|
28 | - case 'checkbox': |
|
29 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
30 | - break; |
|
31 | - case 'select': |
|
32 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
33 | - break; |
|
25 | + case 'radio': |
|
26 | + wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
27 | + break; |
|
28 | + case 'checkbox': |
|
29 | + wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
30 | + break; |
|
31 | + case 'select': |
|
32 | + wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
33 | + break; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | do_action( 'getpaid_before_payment_form_cart', $form ); |
@@ -7,42 +7,42 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $form->get_items() ) ) { |
|
12 | +if (empty($form->get_items())) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) { |
|
16 | +if (!empty($GLOBALS['getpaid_force_checkbox'])) { |
|
17 | 17 | $items_type = 'checkbox'; |
18 | 18 | } |
19 | 19 | |
20 | -if ( empty( $items_type ) ) { |
|
20 | +if (empty($items_type)) { |
|
21 | 21 | $items_type = 'total'; |
22 | 22 | } |
23 | 23 | |
24 | -switch( $items_type ) { |
|
24 | +switch ($items_type) { |
|
25 | 25 | case 'radio': |
26 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
26 | + wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type')); |
|
27 | 27 | break; |
28 | 28 | case 'checkbox': |
29 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
29 | + wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type')); |
|
30 | 30 | break; |
31 | 31 | case 'select': |
32 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
32 | + wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type')); |
|
33 | 33 | break; |
34 | 34 | } |
35 | 35 | |
36 | -do_action( 'getpaid_before_payment_form_cart', $form ); |
|
36 | +do_action('getpaid_before_payment_form_cart', $form); |
|
37 | 37 | |
38 | 38 | // Display the cart totals. |
39 | -if ( ! empty( $hide_cart ) ) { |
|
39 | +if (!empty($hide_cart)) { |
|
40 | 40 | echo '<div class="d-none">'; |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Display the cart totals. |
44 | -wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
44 | +wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type')); |
|
45 | 45 | |
46 | -if ( ! empty( $hide_cart ) ) { |
|
46 | +if (!empty($hide_cart)) { |
|
47 | 47 | echo '</div>'; |
48 | 48 | } |
@@ -7,34 +7,34 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Cart table columns. |
13 | 13 | $columns = array( |
14 | - 'name' => __( 'Item', 'invoicing' ), |
|
15 | - 'price' => __( 'Price', 'invoicing' ), |
|
16 | - 'quantity' => __( 'Qty', 'invoicing' ), |
|
17 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
14 | + 'name' => __('Item', 'invoicing'), |
|
15 | + 'price' => __('Price', 'invoicing'), |
|
16 | + 'quantity' => __('Qty', 'invoicing'), |
|
17 | + 'subtotal' => __('Subtotal', 'invoicing'), |
|
18 | 18 | ); |
19 | 19 | |
20 | -if ( ! empty( $form->invoice ) ) { |
|
21 | - $columns = getpaid_invoice_item_columns( $form->invoice ); |
|
20 | +if (!empty($form->invoice)) { |
|
21 | + $columns = getpaid_invoice_item_columns($form->invoice); |
|
22 | 22 | } |
23 | 23 | |
24 | -if ( isset( $columns['tax_rate'] ) ) { |
|
25 | - unset( $columns['tax_rate'] ); |
|
24 | +if (isset($columns['tax_rate'])) { |
|
25 | + unset($columns['tax_rate']); |
|
26 | 26 | } |
27 | 27 | |
28 | -$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form ); |
|
28 | +$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form); |
|
29 | 29 | |
30 | 30 | ?> |
31 | 31 | <div class="getpaid-payment-form-items-cart border form-group"> |
32 | 32 | |
33 | 33 | <div class="getpaid-payment-form-items-cart-header font-weight-bold bg-light border-bottom py-2 px-3"> |
34 | 34 | <div class="form-row"> |
35 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
36 | - <div class="<?php echo 'name' == $key ? 'col-6' : 'col' ?> <?php echo ( in_array( $key, array( 'subtotal', 'quantity', 'tax_rate' ) ) ) ? 'd-none d-sm-block' : '' ?> getpaid-form-cart-item-<?php echo sanitize_html_class( $key ); ?>"> |
|
37 | - <span><?php echo esc_html( $label ); ?></span> |
|
35 | + <?php foreach ($columns as $key => $label) : ?> |
|
36 | + <div class="<?php echo 'name' == $key ? 'col-6' : 'col' ?> <?php echo (in_array($key, array('subtotal', 'quantity', 'tax_rate'))) ? 'd-none d-sm-block' : '' ?> getpaid-form-cart-item-<?php echo sanitize_html_class($key); ?>"> |
|
37 | + <span><?php echo esc_html($label); ?></span> |
|
38 | 38 | </div> |
39 | 39 | <?php endforeach; ?> |
40 | 40 | </div> |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | <?php |
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | - foreach ( $form->get_items() as $item ) { |
|
47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
46 | + foreach ($form->get_items() as $item) { |
|
47 | + wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns')); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the cart totals. |
51 | - wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
51 | + wpinv_get_template('payment-forms/cart-totals.php', compact('form')); |
|
52 | 52 | |
53 | 53 | ?> |
54 | 54 | </div> |
55 | 55 | |
56 | 56 | <?php |
57 | 57 | |
58 | -do_action( 'getpaid_after_payment_form_cart', $form ); |
|
58 | +do_action('getpaid_after_payment_form_cart', $form); |