@@ -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. |
@@ -24,7 +24,7 @@ |
||
24 | 24 | <div id="template_header_image"> |
25 | 25 | <?php |
26 | 26 | if ( $img = wpinv_get_option( 'email_header_image', '' ) ) { |
27 | - echo '<p style="margin-top:0;"><img style="max-width:100%" src="' . esc_url( $img ) . '" alt="' . esc_attr( wpinv_get_blogname() ) . '" /></p>'; |
|
27 | + echo '<p style="margin-top:0;"><img style="max-width:100%" src="' . esc_url( $img ) . '" alt="' . esc_attr( wpinv_get_blogname() ) . '" /></p>'; |
|
28 | 28 | } |
29 | 29 | ?> |
30 | 30 | </div> |
@@ -30,42 +30,42 @@ |
||
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( $fee['name'] ) . '</div>'; |
|
33 | + // Display the name. |
|
34 | + echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>'; |
|
35 | 35 | |
36 | - // And an optional description. |
|
37 | - $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
38 | - echo "<p class='small'>$description</p>"; |
|
36 | + // And an optional description. |
|
37 | + $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
38 | + echo "<p class='small'>$description</p>"; |
|
39 | 39 | |
40 | 40 | } |
41 | 41 | |
42 | 42 | // Item price. |
43 | 43 | if ( 'price' == $column ) { |
44 | 44 | |
45 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
46 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
47 | - echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
45 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
46 | + if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
47 | + echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
48 | 48 | } else { |
49 | - echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
49 | + echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | // Item quantity. |
54 | 54 | if ( 'quantity' == $column ) { |
55 | - echo '—'; |
|
55 | + echo '—'; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // Item tax. |
59 | 59 | if ( 'tax_rate' == $column ) { |
60 | - echo '—'; |
|
60 | + echo '—'; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Item sub total. |
64 | 64 | if ( 'subtotal' == $column ) { |
65 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
66 | - echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
65 | + if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
66 | + echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
67 | 67 | } else { |
68 | - echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
68 | + echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 |
@@ -126,25 +126,25 @@ |
||
126 | 126 | |
127 | 127 | if ( ! empty( $actions ) ) { |
128 | 128 | |
129 | - echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">'; |
|
129 | + echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">'; |
|
130 | 130 | |
131 | - foreach ( $actions as $key => $action ) { |
|
131 | + foreach ( $actions as $key => $action ) { |
|
132 | 132 | |
133 | - $key = sanitize_html_class( $key ); |
|
134 | - $class = empty( $action['class'] ) ? 'btn-dark' : sanitize_html_class( $action['class'] ); |
|
135 | - $url = empty( $action['url'] ) ? '#' : esc_url( $action['url'] ); |
|
136 | - $attrs = empty( $action['attrs'] ) ? '' : $action['attrs']; |
|
137 | - $anchor = esc_html( $action['name'] ); |
|
133 | + $key = sanitize_html_class( $key ); |
|
134 | + $class = empty( $action['class'] ) ? 'btn-dark' : sanitize_html_class( $action['class'] ); |
|
135 | + $url = empty( $action['url'] ) ? '#' : esc_url( $action['url'] ); |
|
136 | + $attrs = empty( $action['attrs'] ) ? '' : $action['attrs']; |
|
137 | + $anchor = esc_html( $action['name'] ); |
|
138 | 138 | |
139 | - echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" ); |
|
139 | + echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" ); |
|
140 | 140 | } |
141 | 141 | |
142 | - echo '</div>'; |
|
142 | + echo '</div>'; |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
146 | 146 | if ( ! empty( $alert ) ) { |
147 | - echo wp_kses_post( $alert ); |
|
147 | + echo wp_kses_post( $alert ); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | ?> |