@@ -32,33 +32,33 @@ discard block |
||
| 32 | 32 | // Item name. |
| 33 | 33 | if ( 'name' == $column ) { |
| 34 | 34 | |
| 35 | - // Display the name. |
|
| 36 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 35 | + // Display the name. |
|
| 36 | + echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 37 | 37 | |
| 38 | - // And an optional description. |
|
| 39 | - $description = $item->get_description(); |
|
| 38 | + // And an optional description. |
|
| 39 | + $description = $item->get_description(); |
|
| 40 | 40 | |
| 41 | - if ( ! empty( $description ) ) { |
|
| 42 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 41 | + if ( ! empty( $description ) ) { |
|
| 42 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - // Fires before printing the line item actions. |
|
| 46 | - do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
| 45 | + // Fires before printing the line item actions. |
|
| 46 | + do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
| 47 | 47 | |
| 48 | - $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
| 48 | + $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
| 49 | 49 | |
| 50 | - if ( ! empty( $actions ) ) { |
|
| 50 | + if ( ! empty( $actions ) ) { |
|
| 51 | 51 | |
| 52 | - $sanitized = array(); |
|
| 53 | - foreach ( $actions as $key => $action ) { |
|
| 54 | - $key = sanitize_html_class( $key ); |
|
| 55 | - $action = wp_kses_post( $action ); |
|
| 56 | - $sanitized[] = "<span class='$key'>$action</span>"; |
|
| 52 | + $sanitized = array(); |
|
| 53 | + foreach ( $actions as $key => $action ) { |
|
| 54 | + $key = sanitize_html_class( $key ); |
|
| 55 | + $action = wp_kses_post( $action ); |
|
| 56 | + $sanitized[] = "<span class='$key'>$action</span>"; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - echo "<small class='form-text getpaid-line-item-actions'>"; |
|
| 60 | - echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
| 61 | - echo '</small>'; |
|
| 59 | + echo "<small class='form-text getpaid-line-item-actions'>"; |
|
| 60 | + echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
| 61 | + echo '</small>'; |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -66,26 +66,26 @@ discard block |
||
| 66 | 66 | // Item price. |
| 67 | 67 | if ( 'price' == $column ) { |
| 68 | 68 | |
| 69 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
| 70 | - $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
| 71 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 69 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
| 70 | + $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
| 71 | + wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 72 | 72 | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // Tax rate. |
| 76 | 76 | if ( 'tax_rate' == $column ) { |
| 77 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 77 | + echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Item quantity. |
| 81 | 81 | if ( 'quantity' == $column ) { |
| 82 | - echo (float) $item->get_quantity(); |
|
| 82 | + echo (float) $item->get_quantity(); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // Item sub total. |
| 86 | 86 | if ( 'subtotal' == $column ) { |
| 87 | - $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
| 88 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 87 | + $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
| 88 | + wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // Fires when printing a line item column. |
@@ -39,40 +39,40 @@ |
||
| 39 | 39 | if ( 'tax' == $key ) { |
| 40 | 40 | wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
| 41 | 41 | |
| 42 | - if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) { |
|
| 42 | + if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) { |
|
| 43 | 43 | |
| 44 | - $taxes = $invoice->get_total_tax(); |
|
| 45 | - if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) { |
|
| 46 | - echo ' <em class="text-muted small">'; |
|
| 47 | - _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' ); |
|
| 48 | - echo '</em>'; |
|
| 44 | + $taxes = $invoice->get_total_tax(); |
|
| 45 | + if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) { |
|
| 46 | + echo ' <em class="text-muted small">'; |
|
| 47 | + _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' ); |
|
| 48 | + echo '</em>'; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Total Fee. |
| 54 | 54 | if ( 'fee' == $key ) { |
| 55 | - wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
| 55 | + wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | // Total discount. |
| 59 | 59 | if ( 'discount' == $key ) { |
| 60 | - wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
| 60 | + wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Shipping. |
| 64 | 64 | if ( 'shipping' == $key ) { |
| 65 | - wpinv_the_price( $invoice->get_shipping(), $invoice->get_currency() ); |
|
| 65 | + wpinv_the_price( $invoice->get_shipping(), $invoice->get_currency() ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Sub total. |
| 69 | 69 | if ( 'subtotal' == $key ) { |
| 70 | - wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
| 70 | + wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Total. |
| 74 | 74 | if ( 'total' == $key ) { |
| 75 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 75 | + wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // Fires when printing a cart total. |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | // Item name. |
| 32 | 32 | if ( 'name' == $column ) { |
| 33 | 33 | |
| 34 | - // Display the name. |
|
| 35 | - echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
| 34 | + // Display the name. |
|
| 35 | + echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
| 36 | 36 | |
| 37 | - // And an optional description. |
|
| 38 | - $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
| 39 | - echo wp_kses_post( "<small class='form-text text-muted pr-2 m-0'>$description</small>" ); |
|
| 37 | + // And an optional description. |
|
| 38 | + $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
| 39 | + echo wp_kses_post( "<small class='form-text text-muted pr-2 m-0'>$description</small>" ); |
|
| 40 | 40 | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // Item price. |
| 44 | 44 | if ( 'price' == $column ) { |
| 45 | 45 | |
| 46 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
| 47 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 48 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 46 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
| 47 | + if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 48 | + wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 49 | 49 | } else { |
| 50 | 50 | wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
| 51 | 51 | } |
@@ -53,20 +53,20 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | // Item quantity. |
| 55 | 55 | if ( 'quantity' == $column ) { |
| 56 | - echo '—'; |
|
| 56 | + echo '—'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Item tax. |
| 60 | 60 | if ( 'tax_rate' == $column ) { |
| 61 | - echo '—'; |
|
| 61 | + echo '—'; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // Item sub total. |
| 65 | 65 | if ( 'subtotal' == $column ) { |
| 66 | 66 | |
| 67 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
| 68 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 69 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 67 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
| 68 | + if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 69 | + wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 70 | 70 | } else { |
| 71 | 71 | wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
| 72 | 72 | } |
@@ -42,92 +42,92 @@ discard block |
||
| 42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class( $invoice->get_status() ); ?>"> |
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
| 45 | + foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
| 46 | 46 | |
| 47 | - $column_id = sanitize_html_class( $column_id ); |
|
| 48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
| 47 | + $column_id = sanitize_html_class( $column_id ); |
|
| 48 | + $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
| 49 | 49 | |
| 50 | - echo "<td class='" . esc_attr( $column_id . $class ) . "'>"; |
|
| 51 | - switch ( $column_id ) { |
|
| 50 | + echo "<td class='" . esc_attr( $column_id . $class ) . "'>"; |
|
| 51 | + switch ( $column_id ) { |
|
| 52 | 52 | |
| 53 | - case 'invoice-number': |
|
| 54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
| 55 | - break; |
|
| 53 | + case 'invoice-number': |
|
| 54 | + echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
| 55 | + break; |
|
| 56 | 56 | |
| 57 | - case 'created-date': |
|
| 58 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
| 59 | - break; |
|
| 57 | + case 'created-date': |
|
| 58 | + echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
| 59 | + break; |
|
| 60 | 60 | |
| 61 | - case 'payment-date': |
|
| 62 | - if ( $invoice->needs_payment() ) { |
|
| 63 | - echo '—'; |
|
| 64 | - } else { |
|
| 65 | - echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
| 66 | - } |
|
| 61 | + case 'payment-date': |
|
| 62 | + if ( $invoice->needs_payment() ) { |
|
| 63 | + echo '—'; |
|
| 64 | + } else { |
|
| 65 | + echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - break; |
|
| 68 | + break; |
|
| 69 | 69 | |
| 70 | - case 'invoice-status': |
|
| 71 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
| 70 | + case 'invoice-status': |
|
| 71 | + echo wp_kses_post( $invoice->get_status_label_html() ); |
|
| 72 | 72 | |
| 73 | - break; |
|
| 73 | + break; |
|
| 74 | 74 | |
| 75 | - case 'invoice-total': |
|
| 76 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 75 | + case 'invoice-total': |
|
| 76 | + wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 77 | 77 | |
| 78 | - break; |
|
| 78 | + break; |
|
| 79 | 79 | |
| 80 | - case 'invoice-actions': |
|
| 81 | - $actions = array( |
|
| 80 | + case 'invoice-actions': |
|
| 81 | + $actions = array( |
|
| 82 | 82 | |
| 83 | - 'pay' => array( |
|
| 84 | - 'url' => $invoice->get_checkout_payment_url(), |
|
| 85 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 86 | - 'class' => 'btn-success', |
|
| 87 | - ), |
|
| 83 | + 'pay' => array( |
|
| 84 | + 'url' => $invoice->get_checkout_payment_url(), |
|
| 85 | + 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 86 | + 'class' => 'btn-success', |
|
| 87 | + ), |
|
| 88 | 88 | |
| 89 | - 'print' => array( |
|
| 90 | - 'url' => $invoice->get_view_url(), |
|
| 91 | - 'name' => __( 'View', 'invoicing' ), |
|
| 92 | - 'class' => 'btn-secondary', |
|
| 93 | - 'attrs' => 'target="_blank"', |
|
| 94 | - ), |
|
| 95 | - ); |
|
| 89 | + 'print' => array( |
|
| 90 | + 'url' => $invoice->get_view_url(), |
|
| 91 | + 'name' => __( 'View', 'invoicing' ), |
|
| 92 | + 'class' => 'btn-secondary', |
|
| 93 | + 'attrs' => 'target="_blank"', |
|
| 94 | + ), |
|
| 95 | + ); |
|
| 96 | 96 | |
| 97 | - if ( ! $invoice->needs_payment() ) { |
|
| 98 | - unset( $actions['pay'] ); |
|
| 99 | - } |
|
| 97 | + if ( ! $invoice->needs_payment() ) { |
|
| 98 | + unset( $actions['pay'] ); |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - if ( $invoice->needs_payment() ) { |
|
| 102 | - $actions['delete'] = array( |
|
| 103 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
| 104 | - 'name' => __( 'Delete', 'invoicing' ), |
|
| 105 | - 'class' => 'btn-danger', |
|
| 106 | - ); |
|
| 107 | - } |
|
| 101 | + if ( $invoice->needs_payment() ) { |
|
| 102 | + $actions['delete'] = array( |
|
| 103 | + 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
| 104 | + 'name' => __( 'Delete', 'invoicing' ), |
|
| 105 | + 'class' => 'btn-danger', |
|
| 106 | + ); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 109 | + $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 110 | 110 | |
| 111 | - foreach ( $actions as $key => $action ) { |
|
| 112 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
| 113 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
| 114 | - } |
|
| 111 | + foreach ( $actions as $key => $action ) { |
|
| 112 | + $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
| 113 | + echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>'; |
|
| 114 | + } |
|
| 115 | 115 | |
| 116 | - break; |
|
| 116 | + break; |
|
| 117 | 117 | |
| 118 | - default: |
|
| 119 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 120 | - break; |
|
| 118 | + default: |
|
| 119 | + do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 120 | + break; |
|
| 121 | 121 | |
| 122 | 122 | |
| 123 | - } |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 125 | + do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 126 | 126 | |
| 127 | - echo '</td>'; |
|
| 127 | + echo '</td>'; |
|
| 128 | 128 | |
| 129 | - endforeach; |
|
| 130 | - ?> |
|
| 129 | + endforeach; |
|
| 130 | + ?> |
|
| 131 | 131 | </tr> |
| 132 | 132 | |
| 133 | 133 | <?php endforeach; ?> |
@@ -141,18 +141,18 @@ discard block |
||
| 141 | 141 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
| 142 | 142 | <div class="invoicing-Pagination"> |
| 143 | 143 | <?php |
| 144 | - $big = 999999; |
|
| 145 | - |
|
| 146 | - echo wp_kses_post( |
|
| 147 | - paginate_links( |
|
| 148 | - array( |
|
| 149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 150 | - 'format' => '?paged=%#%', |
|
| 151 | - 'total' => $invoices->max_num_pages, |
|
| 152 | - ) |
|
| 153 | - ) |
|
| 144 | + $big = 999999; |
|
| 145 | + |
|
| 146 | + echo wp_kses_post( |
|
| 147 | + paginate_links( |
|
| 148 | + array( |
|
| 149 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 150 | + 'format' => '?paged=%#%', |
|
| 151 | + 'total' => $invoices->max_num_pages, |
|
| 152 | + ) |
|
| 153 | + ) |
|
| 154 | 154 | ); |
| 155 | - ?> |
|
| 155 | + ?> |
|
| 156 | 156 | </div> |
| 157 | 157 | <?php endif; ?> |
| 158 | 158 | |
@@ -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 wp_kses_post( wpautop( $description ) ); |
@@ -26,57 +26,57 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | - // Fires before printing a line item column. |
|
| 30 | - do_action( "getpaid_form_cart_item_before_$key", $item, $form ); |
|
| 29 | + // Fires before printing a line item column. |
|
| 30 | + do_action( "getpaid_form_cart_item_before_$key", $item, $form ); |
|
| 31 | 31 | |
| 32 | - // Item name. |
|
| 33 | - if ( 'name' == $key ) { |
|
| 32 | + // Item name. |
|
| 33 | + if ( 'name' == $key ) { |
|
| 34 | 34 | |
| 35 | - ob_start(); |
|
| 36 | - // And an optional description. |
|
| 37 | - $description = $item->get_description(); |
|
| 35 | + ob_start(); |
|
| 36 | + // And an optional description. |
|
| 37 | + $description = $item->get_description(); |
|
| 38 | 38 | |
| 39 | - if ( ! empty( $description ) ) { |
|
| 40 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 41 | - } |
|
| 39 | + if ( ! empty( $description ) ) { |
|
| 40 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - // Price help text. |
|
| 44 | - $description = getpaid_item_recurring_price_help_text( $item, $currency ); |
|
| 45 | - if ( $description ) { |
|
| 46 | - echo "<small class='getpaid-form-item-price-desc form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 47 | - } |
|
| 43 | + // Price help text. |
|
| 44 | + $description = getpaid_item_recurring_price_help_text( $item, $currency ); |
|
| 45 | + if ( $description ) { |
|
| 46 | + echo "<small class='getpaid-form-item-price-desc form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - do_action( 'getpaid_payment_form_cart_item_description', $item, $form ); |
|
| 49 | + do_action( 'getpaid_payment_form_cart_item_description', $item, $form ); |
|
| 50 | 50 | |
| 51 | - if ( wpinv_current_user_can_manage_invoicing() ) { |
|
| 51 | + if ( wpinv_current_user_can_manage_invoicing() ) { |
|
| 52 | 52 | |
| 53 | - edit_post_link( |
|
| 54 | - __( 'Edit this item.', 'invoicing' ), |
|
| 55 | - '<small class="form-text text-muted">', |
|
| 56 | - '</small>', |
|
| 57 | - $item->get_id(), |
|
| 58 | - 'text-danger' |
|
| 59 | - ); |
|
| 53 | + edit_post_link( |
|
| 54 | + __( 'Edit this item.', 'invoicing' ), |
|
| 55 | + '<small class="form-text text-muted">', |
|
| 56 | + '</small>', |
|
| 57 | + $item->get_id(), |
|
| 58 | + 'text-danger' |
|
| 59 | + ); |
|
| 60 | 60 | |
| 61 | - } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - $description = ob_get_clean(); |
|
| 63 | + $description = ob_get_clean(); |
|
| 64 | 64 | |
| 65 | - // Display the name. |
|
| 66 | - $tootip = empty( $description ) ? '' : ' ' . '<i class="fas fa-xs fa-info gp-tooltip d-sm-none text-muted"></i>'; |
|
| 67 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . wp_kses_post( $tootip ) . '</div>'; |
|
| 65 | + // Display the name. |
|
| 66 | + $tootip = empty( $description ) ? '' : ' ' . '<i class="fas fa-xs fa-info gp-tooltip d-sm-none text-muted"></i>'; |
|
| 67 | + echo '<div class="mb-1">' . esc_html( $item->get_name() ) . wp_kses_post( $tootip ) . '</div>'; |
|
| 68 | 68 | |
| 69 | - if ( ! empty( $description ) ) { |
|
| 70 | - printf( '<span class="d-none d-sm-block getpaid-item-desc">%s</span>', wp_kses_post( $description ) ); |
|
| 71 | - } |
|
| 69 | + if ( ! empty( $description ) ) { |
|
| 70 | + printf( '<span class="d-none d-sm-block getpaid-item-desc">%s</span>', wp_kses_post( $description ) ); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - if ( $item->allows_quantities() ) { |
|
| 74 | - printf( |
|
| 75 | - '<small class="d-sm-none text-muted form-text">%s</small>', |
|
| 76 | - sprintf( |
|
| 77 | - esc_html__( 'Qty %s', 'invoicing' ), |
|
| 78 | - sprintf( |
|
| 79 | - '<input |
|
| 73 | + if ( $item->allows_quantities() ) { |
|
| 74 | + printf( |
|
| 75 | + '<small class="d-sm-none text-muted form-text">%s</small>', |
|
| 76 | + sprintf( |
|
| 77 | + esc_html__( 'Qty %s', 'invoicing' ), |
|
| 78 | + sprintf( |
|
| 79 | + '<input |
|
| 80 | 80 | type="number" |
| 81 | 81 | step="0.01" |
| 82 | 82 | style="width: 48px;" |
@@ -87,53 +87,53 @@ discard block |
||
| 87 | 87 | %s>', |
| 88 | 88 | (float) $item->get_quantity() == 0 ? 1 : (float) $item->get_quantity(), |
| 89 | 89 | floatval( null !== $max_qty ? $max_qty : 1000000000000 ) |
| 90 | - ) |
|
| 91 | - ) |
|
| 92 | - ); |
|
| 93 | - } else { |
|
| 94 | - printf( |
|
| 95 | - '<small class="d-sm-none text-muted form-text">%s</small>', |
|
| 96 | - sprintf( |
|
| 97 | - esc_html__( 'Qty %s', 'invoicing' ), |
|
| 98 | - (float) $item->get_quantity() |
|
| 99 | - ) |
|
| 100 | - ); |
|
| 101 | - } |
|
| 90 | + ) |
|
| 91 | + ) |
|
| 92 | + ); |
|
| 93 | + } else { |
|
| 94 | + printf( |
|
| 95 | + '<small class="d-sm-none text-muted form-text">%s</small>', |
|
| 96 | + sprintf( |
|
| 97 | + esc_html__( 'Qty %s', 'invoicing' ), |
|
| 98 | + (float) $item->get_quantity() |
|
| 99 | + ) |
|
| 100 | + ); |
|
| 101 | + } |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - // Item price. |
|
| 105 | - if ( 'price' == $key ) { |
|
| 104 | + // Item price. |
|
| 105 | + if ( 'price' == $key ) { |
|
| 106 | 106 | |
| 107 | - // Set the currency position. |
|
| 108 | - $position = wpinv_currency_position(); |
|
| 107 | + // Set the currency position. |
|
| 108 | + $position = wpinv_currency_position(); |
|
| 109 | 109 | |
| 110 | - if ( $position == 'left_space' ) { |
|
| 111 | - $position = 'left'; |
|
| 112 | - } |
|
| 110 | + if ( $position == 'left_space' ) { |
|
| 111 | + $position = 'left'; |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - if ( $position == 'right_space' ) { |
|
| 115 | - $position = 'right'; |
|
| 116 | - } |
|
| 114 | + if ( $position == 'right_space' ) { |
|
| 115 | + $position = 'right'; |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - if ( $item->user_can_set_their_price() ) { |
|
| 119 | - $price = max( (float) $item->get_price(), (float) $item->get_minimum_price() ); |
|
| 120 | - $minimum = (float) $item->get_minimum_price(); |
|
| 121 | - $validate_minimum = ''; |
|
| 122 | - $class = ''; |
|
| 123 | - $data_minimum = ''; |
|
| 118 | + if ( $item->user_can_set_their_price() ) { |
|
| 119 | + $price = max( (float) $item->get_price(), (float) $item->get_minimum_price() ); |
|
| 120 | + $minimum = (float) $item->get_minimum_price(); |
|
| 121 | + $validate_minimum = ''; |
|
| 122 | + $class = ''; |
|
| 123 | + $data_minimum = ''; |
|
| 124 | 124 | |
| 125 | - if ( $minimum > 0 ) { |
|
| 126 | - $validate_minimum = sprintf( |
|
| 127 | - esc_attr__( 'The minimum allowed amount is %s', 'invoicing' ), |
|
| 128 | - strip_tags( wpinv_price( $minimum, $currency ) ) |
|
| 129 | - ); |
|
| 125 | + if ( $minimum > 0 ) { |
|
| 126 | + $validate_minimum = sprintf( |
|
| 127 | + esc_attr__( 'The minimum allowed amount is %s', 'invoicing' ), |
|
| 128 | + strip_tags( wpinv_price( $minimum, $currency ) ) |
|
| 129 | + ); |
|
| 130 | 130 | |
| 131 | - $class = 'getpaid-validate-minimum-amount'; |
|
| 131 | + $class = 'getpaid-validate-minimum-amount'; |
|
| 132 | 132 | |
| 133 | - $data_minimum = "data-minimum-amount='" . esc_attr( getpaid_unstandardize_amount( $minimum ) ) . "'"; |
|
| 134 | - } |
|
| 133 | + $data_minimum = "data-minimum-amount='" . esc_attr( getpaid_unstandardize_amount( $minimum ) ) . "'"; |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - ?> |
|
| 136 | + ?> |
|
| 137 | 137 | <div class="input-group input-group-sm"> |
| 138 | 138 | <?php if ( 'left' == $position ) : ?> |
| 139 | 139 | <div class="input-group-prepend"> |
@@ -158,43 +158,43 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | <?php |
| 160 | 160 | |
| 161 | - } else { |
|
| 162 | - echo wp_kses_post( wpinv_price( $item->get_price(), $currency ) ); |
|
| 161 | + } else { |
|
| 162 | + echo wp_kses_post( wpinv_price( $item->get_price(), $currency ) ); |
|
| 163 | 163 | |
| 164 | - ?> |
|
| 164 | + ?> |
|
| 165 | 165 | <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr( $item->get_price() ); ?>'> |
| 166 | 166 | <?php |
| 167 | - } |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - printf( |
|
| 169 | + printf( |
|
| 170 | 170 | '<small class="d-sm-none text-muted form-text getpaid-mobile-item-subtotal">%s</small>', |
| 171 | 171 | sprintf( esc_html__( 'Subtotal: %s', 'invoicing' ), wp_kses_post( wpinv_price( $item->get_sub_total(), $currency ) ) ) |
| 172 | 172 | ); |
| 173 | - } |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | - // Item quantity. |
|
| 176 | - if ( 'quantity' == $key ) { |
|
| 175 | + // Item quantity. |
|
| 176 | + if ( 'quantity' == $key ) { |
|
| 177 | 177 | |
| 178 | - if ( $item->allows_quantities() ) { |
|
| 179 | - ?> |
|
| 178 | + if ( $item->allows_quantities() ) { |
|
| 179 | + ?> |
|
| 180 | 180 | <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][quantity]' type="number" step="0.01" style='width: 64px; line-height: 1; min-height: 35px;' class='getpaid-item-quantity-input p-1 align-middle font-weight-normal shadow-none m-0 rounded-0 text-center border' value='<?php echo (float) $item->get_quantity() == 0 ? 1 : (float) $item->get_quantity(); ?>' min='1' <?php echo null !== $max_qty ? 'max="' . (float) $max_qty . '"' : ''; ?> required> |
| 181 | 181 | <?php |
| 182 | - } else { |
|
| 183 | - echo (float) $item->get_quantity(); |
|
| 184 | - echo ' '; |
|
| 185 | - ?> |
|
| 182 | + } else { |
|
| 183 | + echo (float) $item->get_quantity(); |
|
| 184 | + echo ' '; |
|
| 185 | + ?> |
|
| 186 | 186 | <input type='hidden' name='getpaid-items[<?php echo (int) $item->get_id(); ?>][quantity]' class='getpaid-item-quantity-input' value='<?php echo (float) $item->get_quantity(); ?>'> |
| 187 | 187 | <?php |
| 188 | - } |
|
| 188 | + } |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - // Item sub total. |
|
| 192 | - if ( 'subtotal' == $key ) { |
|
| 193 | - echo wp_kses_post( wpinv_price( $item->get_sub_total(), $currency ) ); |
|
| 194 | - } |
|
| 191 | + // Item sub total. |
|
| 192 | + if ( 'subtotal' == $key ) { |
|
| 193 | + echo wp_kses_post( wpinv_price( $item->get_sub_total(), $currency ) ); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | - do_action( "getpaid_payment_form_cart_item_$key", $item, $form ); |
|
| 197 | - ?> |
|
| 196 | + do_action( "getpaid_payment_form_cart_item_$key", $item, $form ); |
|
| 197 | + ?> |
|
| 198 | 198 | |
| 199 | 199 | </div> |
| 200 | 200 | |
@@ -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 | - wpinv_the_price( 0, $currency ); |
|
| 67 | - } |
|
| 64 | + // Total tax. |
|
| 65 | + if ( in_array( $key, array( 'tax', 'discount', 'subtotal', 'total', 'fees' ) ) ) { |
|
| 66 | + wpinv_the_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 | |
@@ -1,32 +1,32 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - // Is the request set up correctly? |
|
| 4 | - if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
| 5 | - return aui()->alert( |
|
| 3 | + // Is the request set up correctly? |
|
| 4 | + if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
| 5 | + return aui()->alert( |
|
| 6 | 6 | array( |
| 7 | - 'type' => 'warning', |
|
| 8 | - 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
| 7 | + 'type' => 'warning', |
|
| 8 | + 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
| 9 | 9 | ) |
| 10 | 10 | ); |
| 11 | 11 | wp_die( esc_html__( 'No payment form or item selected', 'invoicing' ), 400 ); |
| 12 | - } |
|
| 12 | + } |
|
| 13 | 13 | |
| 14 | - // Payment form or button? |
|
| 15 | - if ( ! empty( $_GET['form'] ) ) { |
|
| 14 | + // Payment form or button? |
|
| 15 | + if ( ! empty( $_GET['form'] ) ) { |
|
| 16 | 16 | |
| 17 | - $shortcode = sprintf( |
|
| 17 | + $shortcode = sprintf( |
|
| 18 | 18 | '[getpaid form=%s]', |
| 19 | 19 | (int) $_GET['form'] |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | - } else { |
|
| 22 | + } else { |
|
| 23 | 23 | |
| 24 | - $shortcode = sprintf( |
|
| 24 | + $shortcode = sprintf( |
|
| 25 | 25 | '[getpaid item=%s]', |
| 26 | 26 | esc_attr( urldecode( $_GET['item'] ) ) |
| 27 | - ); |
|
| 27 | + ); |
|
| 28 | 28 | |
| 29 | - } |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | ?> |
| 32 | 32 | |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | <title>GetPaid</title> |
| 46 | 46 | <?php |
| 47 | - wp_enqueue_scripts(); |
|
| 48 | - wp_print_styles(); |
|
| 49 | - wp_print_head_scripts(); |
|
| 50 | - wp_custom_css_cb(); |
|
| 51 | - wpinv_get_template( 'frontend-head.php' ); |
|
| 52 | - ?> |
|
| 47 | + wp_enqueue_scripts(); |
|
| 48 | + wp_print_styles(); |
|
| 49 | + wp_print_head_scripts(); |
|
| 50 | + wp_custom_css_cb(); |
|
| 51 | + wpinv_get_template( 'frontend-head.php' ); |
|
| 52 | + ?> |
|
| 53 | 53 | |
| 54 | 54 | <style type="text/css"> |
| 55 | 55 | .body{ |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | <body class="body page-template-default page"> |
| 84 | 84 | <div id="getpaid-form-embed" class="container my-5 page type-page status-publish hentry post post-content"> |
| 85 | 85 | <?php |
| 86 | - do_action( 'getpaid_payment_form_embed_top' ); |
|
| 87 | - echo do_shortcode( $shortcode ); |
|
| 88 | - do_action( 'getpaid_payment_form_embed_bottom' ); |
|
| 89 | - wpinv_get_template( 'frontend-footer.php' ); |
|
| 90 | - ?> |
|
| 86 | + do_action( 'getpaid_payment_form_embed_top' ); |
|
| 87 | + echo do_shortcode( $shortcode ); |
|
| 88 | + do_action( 'getpaid_payment_form_embed_bottom' ); |
|
| 89 | + wpinv_get_template( 'frontend-footer.php' ); |
|
| 90 | + ?> |
|
| 91 | 91 | </div> |
| 92 | 92 | <?php wp_footer(); ?> |
| 93 | 93 | </body> |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // And the optional invoice id. |
| 50 | 50 | if ( ! empty( $form->invoice ) ) { |
| 51 | - getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
| 51 | + getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // We also want to include the form id. |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | foreach ( $form->get_elements() as $element ) { |
| 70 | 70 | |
| 71 | - if ( isset( $element['type'] ) ) { |
|
| 72 | - $grid_class = getpaid_get_form_element_grid_class( $element ); |
|
| 73 | - echo "<div class='" . esc_attr( $grid_class ) . "'>"; |
|
| 74 | - do_action( 'getpaid_payment_form_element', $element, $form ); |
|
| 75 | - do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
| 76 | - echo '</div>'; |
|
| 71 | + if ( isset( $element['type'] ) ) { |
|
| 72 | + $grid_class = getpaid_get_form_element_grid_class( $element ); |
|
| 73 | + echo "<div class='" . esc_attr( $grid_class ) . "'>"; |
|
| 74 | + do_action( 'getpaid_payment_form_element', $element, $form ); |
|
| 75 | + do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
| 76 | + echo '</div>'; |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |