@@ -64,8 +64,8 @@ |
||
64 | 64 | $description = wpinv_get_gateway_description( $gateway ); |
65 | 65 | |
66 | 66 | if ( wpinv_is_test_mode( $gateway ) ) { |
67 | - $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
68 | - $description = "$description $sandbox_notice"; |
|
67 | + $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
68 | + $description = "$description $sandbox_notice"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | echo wpautop( wp_kses_post( $description ) ); |
@@ -21,20 +21,20 @@ |
||
21 | 21 | |
22 | 22 | foreach ( $file_types as $file_type ) { |
23 | 23 | |
24 | - if ( isset( $all_types[ $file_type ] ) ) { |
|
25 | - $types[] = $all_types[ $file_type ]; |
|
26 | - $file_type = explode( '|', $file_type ); |
|
27 | - |
|
28 | - foreach ( $file_type as $type ) { |
|
29 | - $type = trim( $type ); |
|
30 | - $types[] = ".$type"; |
|
31 | - $_types[] = $type; |
|
32 | - } |
|
24 | + if ( isset( $all_types[ $file_type ] ) ) { |
|
25 | + $types[] = $all_types[ $file_type ]; |
|
26 | + $file_type = explode( '|', $file_type ); |
|
27 | + |
|
28 | + foreach ( $file_type as $type ) { |
|
29 | + $type = trim( $type ); |
|
30 | + $types[] = ".$type"; |
|
31 | + $_types[] = $type; |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | 36 | if ( ! empty( $required ) ) { |
37 | - $label .= "<span class='text-danger'> *</span>"; |
|
37 | + $label .= "<span class='text-danger'> *</span>"; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | ?> |
@@ -11,26 +11,26 @@ discard block |
||
11 | 11 | |
12 | 12 | // Totals rows. |
13 | 13 | $totals = apply_filters( |
14 | - 'getpaid_payment_form_cart_table_totals', |
|
15 | - array( |
|
16 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
17 | - 'tax' => __( 'Tax', 'invoicing' ), |
|
18 | - 'fees' => __( 'Fee', 'invoicing' ), |
|
19 | - 'discount' => __( 'Discount', 'invoicing' ), |
|
20 | - 'total' => __( 'Total', 'invoicing' ), |
|
21 | - ), |
|
22 | - $form |
|
14 | + 'getpaid_payment_form_cart_table_totals', |
|
15 | + array( |
|
16 | + 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
17 | + 'tax' => __( 'Tax', 'invoicing' ), |
|
18 | + 'fees' => __( 'Fee', 'invoicing' ), |
|
19 | + 'discount' => __( 'Discount', 'invoicing' ), |
|
20 | + 'total' => __( 'Total', 'invoicing' ), |
|
21 | + ), |
|
22 | + $form |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $currency = $form->get_currency(); |
26 | 26 | $country = wpinv_get_default_country(); |
27 | 27 | |
28 | 28 | if ( ! empty( $form->invoice ) ) { |
29 | - $country = $form->invoice->get_country(); |
|
29 | + $country = $form->invoice->get_country(); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | if ( ! wpinv_use_taxes() && isset( $totals['tax'] ) ) { |
33 | - unset( $totals['tax'] ); |
|
33 | + unset( $totals['tax'] ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | do_action( 'getpaid_before_payment_form_cart_totals', $form, $totals ); |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | |
62 | 62 | <?php |
63 | 63 | |
64 | - // Total tax. |
|
65 | - if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) { |
|
66 | - echo wpinv_price( 0, $currency ); |
|
67 | - } |
|
64 | + // Total tax. |
|
65 | + if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) { |
|
66 | + echo wpinv_price( 0, $currency ); |
|
67 | + } |
|
68 | 68 | |
69 | - do_action( "getpaid_payment_form_cart_totals_$key", $form ); |
|
70 | - ?> |
|
69 | + do_action( "getpaid_payment_form_cart_totals_$key", $form ); |
|
70 | + ?> |
|
71 | 71 | |
72 | 72 | </div> |
73 | 73 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // And the optional invoice id. |
48 | 48 | if ( ! empty( $form->invoice ) ) { |
49 | - echo getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
49 | + echo getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // We also want to include the form id. |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | |
67 | 67 | foreach ( $form->get_elements() as $element ) { |
68 | 68 | |
69 | - if ( isset( $element['type'] ) ) { |
|
70 | - $grid_class = esc_attr( getpaid_get_form_element_grid_class( $element ) ); |
|
71 | - echo "<div class='$grid_class'>"; |
|
72 | - do_action( 'getpaid_payment_form_element', $element, $form ); |
|
73 | - do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
74 | - echo '</div>'; |
|
69 | + if ( isset( $element['type'] ) ) { |
|
70 | + $grid_class = esc_attr( getpaid_get_form_element_grid_class( $element ) ); |
|
71 | + echo "<div class='$grid_class'>"; |
|
72 | + do_action( 'getpaid_payment_form_element', $element, $form ); |
|
73 | + do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
74 | + echo '</div>'; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | 46 | foreach ( $form->get_items() as $item ) { |
47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
47 | + wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the cart totals. |
@@ -44,12 +44,12 @@ |
||
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | 46 | foreach ( $invoice->get_items() as $item ) { |
47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
47 | + wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the fee totals. |
51 | 51 | foreach ( $invoice->get_fees() as $fee ) { |
52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
52 | + wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | ?> |
@@ -20,7 +20,7 @@ |
||
20 | 20 | <a href="<?php echo esc_url( add_query_arg( 'user_id', $invoice->get_user_id(), self_admin_url( 'user-edit.php' ) ) ); ?>"><?php echo esc_html( $invoice->get_user_full_name() ); ?></a> |
21 | 21 | <?php |
22 | 22 | } else { |
23 | - echo esc_html( $invoice->get_user_full_name() ); } |
|
23 | + echo esc_html( $invoice->get_user_full_name() ); } |
|
24 | 24 | ?> |
25 | 25 | </td> |
26 | 26 | </tr> |
@@ -45,26 +45,26 @@ |
||
45 | 45 | |
46 | 46 | // Total tax. |
47 | 47 | if ( 'tax' == $key ) { |
48 | - echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
|
48 | + echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if ( 'fee' == $key ) { |
52 | - echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
52 | + echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | // Total discount. |
56 | 56 | if ( 'discount' == $key ) { |
57 | - echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
57 | + echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Sub total. |
61 | 61 | if ( 'subtotal' == $key ) { |
62 | - echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
62 | + echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | // Total. |
66 | 66 | if ( 'total' == $key ) { |
67 | - echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
67 | + echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // Fires when printing a cart total in an email. |
@@ -30,41 +30,41 @@ |
||
30 | 30 | // Item name. |
31 | 31 | if ( 'name' == $column ) { |
32 | 32 | |
33 | - // Display the name. |
|
34 | - echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>'; |
|
33 | + // Display the name. |
|
34 | + echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>'; |
|
35 | 35 | |
36 | - // And an optional description. |
|
37 | - $description = $item->get_description(); |
|
36 | + // And an optional description. |
|
37 | + $description = $item->get_description(); |
|
38 | 38 | |
39 | - if ( ! empty( $description ) ) { |
|
40 | - $description = wp_kses_post( $description ); |
|
41 | - echo "<p class='small'>$description</p>"; |
|
39 | + if ( ! empty( $description ) ) { |
|
40 | + $description = wp_kses_post( $description ); |
|
41 | + echo "<p class='small'>$description</p>"; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | // Item price. |
46 | 46 | if ( 'price' == $column ) { |
47 | 47 | |
48 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
49 | - $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
50 | - echo wpinv_price( $price, $invoice->get_currency() ); |
|
48 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
49 | + $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
50 | + echo wpinv_price( $price, $invoice->get_currency() ); |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | |
54 | 54 | // Item quantity. |
55 | 55 | if ( 'quantity' == $column ) { |
56 | - echo (float) $item->get_quantity(); |
|
56 | + echo (float) $item->get_quantity(); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Tax rate. |
60 | 60 | if ( 'tax_rate' == $column ) { |
61 | - echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%'; |
|
61 | + echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Item sub total. |
65 | 65 | if ( 'subtotal' == $column ) { |
66 | - $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
67 | - echo wpinv_price( $subtotal, $invoice->get_currency() ); |
|
66 | + $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
67 | + echo wpinv_price( $subtotal, $invoice->get_currency() ); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // Fires when printing a line item column. |