@@ -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 mb-3"> |
| 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 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 esc_attr( $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 esc_attr($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); |
|
@@ -7,31 +7,31 @@ |
||
| 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() ] = $item->get_name() . ' — ' . wpinv_price( $item->get_initial_price() ); |
|
| 14 | +foreach ($form->get_items() as $item) { |
|
| 15 | + if (!$item->is_required) { |
|
| 16 | + $selectable[$item->get_id()] = $item->get_name() . ' — ' . wpinv_price($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 | |
| 24 | 24 | echo '<div class="getpaid-payment-form-items-checkbox form-group mb-3">'; |
| 25 | 25 | |
| 26 | -foreach ( $selectable as $item_id => $item_name ) { |
|
| 26 | +foreach ($selectable as $item_id => $item_name) { |
|
| 27 | 27 | |
| 28 | - $is_checked = get_post_meta( $item_id, 'selected_by_default', true ); |
|
| 28 | + $is_checked = get_post_meta($item_id, 'selected_by_default', true); |
|
| 29 | 29 | |
| 30 | 30 | aui()->input( |
| 31 | 31 | array( |
| 32 | 32 | 'type' => 'checkbox', |
| 33 | 33 | 'name' => 'getpaid-payment-form-selected-item', |
| 34 | - 'id' => 'getpaid-payment-form-selected-item' . uniqid( '_' ) . $item_id, |
|
| 34 | + 'id' => 'getpaid-payment-form-selected-item' . uniqid('_') . $item_id, |
|
| 35 | 35 | 'label' => $item_name, |
| 36 | 36 | 'value' => $item_id, |
| 37 | 37 | 'no_wrap' => true, |
@@ -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 | |
| 14 | 14 | <div class='form-group mb-3'> |
| 15 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The total payable text', 'invoicing' ); ?></label> |
|
| 15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The total payable text', 'invoicing'); ?></label> |
|
| 16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
| 17 | 17 | </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 company name. |
| 13 | -$company_name = wpinv_get_option( 'vat_company_name' ); |
|
| 13 | +$company_name = wpinv_get_option('vat_company_name'); |
|
| 14 | 14 | |
| 15 | -if ( empty( $company_name ) ) { |
|
| 15 | +if (empty($company_name)) { |
|
| 16 | 16 | $company_name = wpinv_get_business_name(); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // Prepare the VAT number. |
| 20 | -$vat_number = wpinv_get_option( 'vat_number' ); |
|
| 20 | +$vat_number = wpinv_get_option('vat_number'); |
|
| 21 | 21 | |
| 22 | 22 | ?> |
| 23 | 23 | <div class="getpaid-company-address form-group mb-3"> |
@@ -25,36 +25,36 @@ discard block |
||
| 25 | 25 | <div class="row"> |
| 26 | 26 | |
| 27 | 27 | <div class="invoice-company-address-label col-2"> |
| 28 | - <strong><?php esc_html_e( 'From:', 'invoicing' ); ?></strong> |
|
| 28 | + <strong><?php esc_html_e('From:', 'invoicing'); ?></strong> |
|
| 29 | 29 | </div> |
| 30 | 30 | |
| 31 | 31 | <div class="invoice-company-address-value col-10"> |
| 32 | 32 | |
| 33 | - <?php do_action( 'getpaid_company_address_top' ); ?> |
|
| 33 | + <?php do_action('getpaid_company_address_top'); ?> |
|
| 34 | 34 | |
| 35 | 35 | <div class="name"> |
| 36 | - <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 37 | - <?php echo esc_html( $company_name ); ?> |
|
| 36 | + <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
| 37 | + <?php echo esc_html($company_name); ?> |
|
| 38 | 38 | </a> |
| 39 | 39 | </div> |
| 40 | 40 | |
| 41 | - <?php if ( $address = wpinv_get_business_address() ) { ?> |
|
| 42 | - <?php echo wp_kses_post( $address ); ?> |
|
| 41 | + <?php if ($address = wpinv_get_business_address()) { ?> |
|
| 42 | + <?php echo wp_kses_post($address); ?> |
|
| 43 | 43 | <?php } ?> |
| 44 | 44 | |
| 45 | - <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?> |
|
| 45 | + <?php if ($email_from = wpinv_mail_get_from_address()) { ?> |
|
| 46 | 46 | <div class="email_from"> |
| 47 | - <?php echo wp_sprintf( esc_html__( 'Email: %s', 'invoicing' ), esc_html( $email_from ) ); ?> |
|
| 47 | + <?php echo wp_sprintf(esc_html__('Email: %s', 'invoicing'), esc_html($email_from)); ?> |
|
| 48 | 48 | </div> |
| 49 | 49 | <?php } ?> |
| 50 | 50 | |
| 51 | - <?php if ( ! empty( $vat_number ) ) { ?> |
|
| 51 | + <?php if (!empty($vat_number)) { ?> |
|
| 52 | 52 | <div class="email_from"> |
| 53 | - <?php echo wp_sprintf( esc_html__( 'VAT Number: %s', 'invoicing' ), esc_html( $vat_number ) ); ?> |
|
| 53 | + <?php echo wp_sprintf(esc_html__('VAT Number: %s', 'invoicing'), esc_html($vat_number)); ?> |
|
| 54 | 54 | </div> |
| 55 | 55 | <?php } ?> |
| 56 | 56 | |
| 57 | - <?php do_action( 'getpaid_company_address_bottom' ); ?> |
|
| 57 | + <?php do_action('getpaid_company_address_bottom'); ?> |
|
| 58 | 58 | |
| 59 | 59 | </div> |
| 60 | 60 | |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 10 | +if (!defined('ABSPATH')) { |
|
| 11 | 11 | exit; // Exit if accessed directly |
| 12 | 12 | } |
| 13 | 13 | |
@@ -21,24 +21,24 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @param WP_Post $post |
| 23 | 23 | */ |
| 24 | - public static function output( $post ) { |
|
| 24 | + public static function output($post) { |
|
| 25 | 25 | |
| 26 | 26 | // Prepare the discount. |
| 27 | - $discount = new WPInv_Discount( $post ); |
|
| 27 | + $discount = new WPInv_Discount($post); |
|
| 28 | 28 | |
| 29 | 29 | // Nonce field. |
| 30 | - wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' ); |
|
| 30 | + wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce'); |
|
| 31 | 31 | |
| 32 | - do_action( 'wpinv_discount_form_top', $discount ); |
|
| 32 | + do_action('wpinv_discount_form_top', $discount); |
|
| 33 | 33 | |
| 34 | 34 | // Set the currency position. |
| 35 | 35 | $position = wpinv_currency_position(); |
| 36 | 36 | |
| 37 | - if ( $position == 'left_space' ) { |
|
| 37 | + if ($position == 'left_space') { |
|
| 38 | 38 | $position = 'left'; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if ( $position == 'right_space' ) { |
|
| 41 | + if ($position == 'right_space') { |
|
| 42 | 42 | $position = 'right'; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -52,69 +52,69 @@ discard block |
||
| 52 | 52 | </style> |
| 53 | 53 | <div class='bsui' style='max-width: 600px;padding-top: 10px;'> |
| 54 | 54 | |
| 55 | - <?php do_action( 'wpinv_discount_form_first', $discount ); ?> |
|
| 55 | + <?php do_action('wpinv_discount_form_first', $discount); ?> |
|
| 56 | 56 | |
| 57 | - <?php do_action( 'wpinv_discount_form_before_code', $discount ); ?> |
|
| 57 | + <?php do_action('wpinv_discount_form_before_code', $discount); ?> |
|
| 58 | 58 | |
| 59 | 59 | <div class="form-group mb-3 row"> |
| 60 | 60 | <label for="wpinv_discount_code" class="col-sm-3 col-form-label"> |
| 61 | - <?php esc_html_e( 'Discount Code', 'invoicing' ); ?> |
|
| 61 | + <?php esc_html_e('Discount Code', 'invoicing'); ?> |
|
| 62 | 62 | </label> |
| 63 | 63 | <div class="col-sm-8"> |
| 64 | 64 | <div class="row"> |
| 65 | 65 | <div class="col-sm-12 form-group mb-3"> |
| 66 | - <input type="text" value="<?php echo esc_attr( $discount->get_code( 'edit' ) ); ?>" placeholder="SUMMER_SALE" name="wpinv_discount_code" id="wpinv_discount_code" style="width: 100%;" /> |
|
| 66 | + <input type="text" value="<?php echo esc_attr($discount->get_code('edit')); ?>" placeholder="SUMMER_SALE" name="wpinv_discount_code" id="wpinv_discount_code" style="width: 100%;" /> |
|
| 67 | 67 | </div> |
| 68 | 68 | <div class="col-sm-12"> |
| 69 | 69 | <?php |
| 70 | - do_action( 'wpinv_discount_form_before_single_use', $discount ); |
|
| 70 | + do_action('wpinv_discount_form_before_single_use', $discount); |
|
| 71 | 71 | |
| 72 | 72 | aui()->input( |
| 73 | 73 | array( |
| 74 | 74 | 'id' => 'wpinv_discount_single_use', |
| 75 | 75 | 'name' => 'wpinv_discount_single_use', |
| 76 | 76 | 'type' => 'checkbox', |
| 77 | - 'label' => __( 'Each customer can only use this discount once', 'invoicing' ), |
|
| 77 | + 'label' => __('Each customer can only use this discount once', 'invoicing'), |
|
| 78 | 78 | 'value' => '1', |
| 79 | 79 | 'checked' => $discount->is_single_use(), |
| 80 | 80 | ), |
| 81 | 81 | true |
| 82 | 82 | ); |
| 83 | 83 | |
| 84 | - do_action( 'wpinv_discount_form_single_use', $discount ); |
|
| 84 | + do_action('wpinv_discount_form_single_use', $discount); |
|
| 85 | 85 | ?> |
| 86 | 86 | </div> |
| 87 | 87 | <div class="col-sm-12"> |
| 88 | 88 | <?php |
| 89 | - do_action( 'wpinv_discount_form_before_recurring', $discount ); |
|
| 89 | + do_action('wpinv_discount_form_before_recurring', $discount); |
|
| 90 | 90 | |
| 91 | 91 | aui()->input( |
| 92 | 92 | array( |
| 93 | 93 | 'id' => 'wpinv_discount_recurring', |
| 94 | 94 | 'name' => 'wpinv_discount_recurring', |
| 95 | 95 | 'type' => 'checkbox', |
| 96 | - 'label' => __( 'Apply this discount to all recurring payments for subscriptions', 'invoicing' ), |
|
| 96 | + 'label' => __('Apply this discount to all recurring payments for subscriptions', 'invoicing'), |
|
| 97 | 97 | 'value' => '1', |
| 98 | 98 | 'checked' => $discount->is_recurring(), |
| 99 | 99 | ), |
| 100 | 100 | true |
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | - do_action( 'wpinv_discount_form_recurring', $discount ); |
|
| 103 | + do_action('wpinv_discount_form_recurring', $discount); |
|
| 104 | 104 | ?> |
| 105 | 105 | </div> |
| 106 | 106 | </div> |
| 107 | 107 | </div> |
| 108 | 108 | <div class="col-sm-1 pt-2 pl-0"> |
| 109 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter a discount code such as 10OFF.', 'invoicing' ); ?>"></span> |
|
| 109 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter a discount code such as 10OFF.', 'invoicing'); ?>"></span> |
|
| 110 | 110 | </div> |
| 111 | 111 | </div> |
| 112 | - <?php do_action( 'wpinv_discount_form_code', $discount ); ?> |
|
| 112 | + <?php do_action('wpinv_discount_form_code', $discount); ?> |
|
| 113 | 113 | |
| 114 | - <?php do_action( 'wpinv_discount_form_before_type', $discount ); ?> |
|
| 114 | + <?php do_action('wpinv_discount_form_before_type', $discount); ?> |
|
| 115 | 115 | <div class="form-group mb-3 row"> |
| 116 | 116 | <label for="wpinv_discount_type" class="col-sm-3 col-form-label"> |
| 117 | - <?php esc_html_e( 'Discount Type', 'invoicing' ); ?> |
|
| 117 | + <?php esc_html_e('Discount Type', 'invoicing'); ?> |
|
| 118 | 118 | </label> |
| 119 | 119 | <div class="col-sm-8"> |
| 120 | 120 | <?php |
@@ -122,9 +122,9 @@ discard block |
||
| 122 | 122 | array( |
| 123 | 123 | 'id' => 'wpinv_discount_type', |
| 124 | 124 | 'name' => 'wpinv_discount_type', |
| 125 | - 'label' => __( 'Discount Type', 'invoicing' ), |
|
| 126 | - 'placeholder' => __( 'Select Discount Type', 'invoicing' ), |
|
| 127 | - 'value' => $discount->get_type( 'edit' ), |
|
| 125 | + 'label' => __('Discount Type', 'invoicing'), |
|
| 126 | + 'placeholder' => __('Select Discount Type', 'invoicing'), |
|
| 127 | + 'value' => $discount->get_type('edit'), |
|
| 128 | 128 | 'select2' => true, |
| 129 | 129 | 'data-allow-clear' => 'false', |
| 130 | 130 | 'options' => wpinv_get_discount_types(), |
@@ -134,49 +134,49 @@ discard block |
||
| 134 | 134 | ?> |
| 135 | 135 | </div> |
| 136 | 136 | <div class="col-sm-1 pt-2 pl-0"> |
| 137 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Discount type.', 'invoicing' ); ?>"></span> |
|
| 137 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Discount type.', 'invoicing'); ?>"></span> |
|
| 138 | 138 | </div> |
| 139 | 139 | </div> |
| 140 | - <?php do_action( 'wpinv_discount_form_type', $discount ); ?> |
|
| 140 | + <?php do_action('wpinv_discount_form_type', $discount); ?> |
|
| 141 | 141 | |
| 142 | - <?php do_action( 'wpinv_discount_form_before_amount', $discount ); ?> |
|
| 143 | - <div class="form-group mb-3 row <?php echo esc_attr( $discount->get_type( 'edit' ) ); ?>" id="wpinv_discount_amount_wrap"> |
|
| 142 | + <?php do_action('wpinv_discount_form_before_amount', $discount); ?> |
|
| 143 | + <div class="form-group mb-3 row <?php echo esc_attr($discount->get_type('edit')); ?>" id="wpinv_discount_amount_wrap"> |
|
| 144 | 144 | <label for="wpinv_discount_amount" class="col-sm-3 col-form-label"> |
| 145 | - <?php esc_html_e( 'Discount Amount', 'invoicing' ); ?> |
|
| 145 | + <?php esc_html_e('Discount Amount', 'invoicing'); ?> |
|
| 146 | 146 | </label> |
| 147 | 147 | <div class="col-sm-8"> |
| 148 | 148 | <div class="input-group input-group-sm"> |
| 149 | 149 | |
| 150 | - <?php if ( 'left' == $position ) : ?> |
|
| 151 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 150 | + <?php if ('left' == $position) : ?> |
|
| 151 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 152 | 152 | <div class="input-group-prepend left wpinv-if-flat"> |
| 153 | 153 | <span class="input-group-text"> |
| 154 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 154 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 155 | 155 | </span> |
| 156 | 156 | </div> |
| 157 | 157 | <?php else : ?> |
| 158 | 158 | <span class="input-group-text left wpinv-if-flat"> |
| 159 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 159 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 160 | 160 | </span> |
| 161 | 161 | <?php endif; ?> |
| 162 | 162 | <?php endif; ?> |
| 163 | 163 | |
| 164 | - <input type="text" name="wpinv_discount_amount" id="wpinv_discount_amount" value="<?php echo esc_attr( $discount->get_amount( 'edit' ) ); ?>" placeholder="0" class="form-control"> |
|
| 164 | + <input type="text" name="wpinv_discount_amount" id="wpinv_discount_amount" value="<?php echo esc_attr($discount->get_amount('edit')); ?>" placeholder="0" class="form-control"> |
|
| 165 | 165 | |
| 166 | - <?php if ( 'right' == $position ) : ?> |
|
| 167 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 166 | + <?php if ('right' == $position) : ?> |
|
| 167 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 168 | 168 | <div class="input-group-append right wpinv-if-flat"> |
| 169 | 169 | <span class="input-group-text"> |
| 170 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 170 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 171 | 171 | </span> |
| 172 | 172 | </div> |
| 173 | 173 | <?php else : ?> |
| 174 | 174 | <span class="input-group-text left wpinv-if-flat"> |
| 175 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 175 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 176 | 176 | </span> |
| 177 | 177 | <?php endif; ?> |
| 178 | 178 | <?php endif; ?> |
| 179 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 179 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 180 | 180 | <div class="input-group-append right wpinv-if-percent"> |
| 181 | 181 | <span class="input-group-text">%</span> |
| 182 | 182 | </div> |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | </div> |
| 187 | 187 | </div> |
| 188 | 188 | <div class="col-sm-1 pt-2 pl-0"> |
| 189 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter the discount value. Ex: 10', 'invoicing' ); ?>"></span> |
|
| 189 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter the discount value. Ex: 10', 'invoicing'); ?>"></span> |
|
| 190 | 190 | </div> |
| 191 | 191 | </div> |
| 192 | - <?php do_action( 'wpinv_discount_form_amount', $discount ); ?> |
|
| 192 | + <?php do_action('wpinv_discount_form_amount', $discount); ?> |
|
| 193 | 193 | |
| 194 | - <?php do_action( 'wpinv_discount_form_before_items', $discount ); ?> |
|
| 194 | + <?php do_action('wpinv_discount_form_before_items', $discount); ?> |
|
| 195 | 195 | <div class="form-group mb-3 row"> |
| 196 | 196 | <label for="wpinv_discount_items" class="col-sm-3 col-form-label"> |
| 197 | - <?php esc_html_e( 'Items', 'invoicing' ); ?> |
|
| 197 | + <?php esc_html_e('Items', 'invoicing'); ?> |
|
| 198 | 198 | </label> |
| 199 | 199 | <div class="col-sm-8"> |
| 200 | 200 | <?php |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | array( |
| 203 | 203 | 'id' => 'wpinv_discount_items', |
| 204 | 204 | 'name' => 'wpinv_discount_items[]', |
| 205 | - 'label' => __( 'Items', 'invoicing' ), |
|
| 206 | - 'placeholder' => __( 'Select Items', 'invoicing' ), |
|
| 207 | - 'value' => $discount->get_items( 'edit' ), |
|
| 205 | + 'label' => __('Items', 'invoicing'), |
|
| 206 | + 'placeholder' => __('Select Items', 'invoicing'), |
|
| 207 | + 'value' => $discount->get_items('edit'), |
|
| 208 | 208 | 'select2' => true, |
| 209 | 209 | 'multiple' => true, |
| 210 | 210 | 'data-allow-clear' => 'false', |
@@ -215,15 +215,15 @@ discard block |
||
| 215 | 215 | ?> |
| 216 | 216 | </div> |
| 217 | 217 | <div class="col-sm-1 pt-2 pl-0"> |
| 218 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Select the items that are allowed to use this discount or leave blank to use this discount all items.', 'invoicing' ); ?>"></span> |
|
| 218 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Select the items that are allowed to use this discount or leave blank to use this discount all items.', 'invoicing'); ?>"></span> |
|
| 219 | 219 | </div> |
| 220 | 220 | </div> |
| 221 | - <?php do_action( 'wpinv_discount_form_items', $discount ); ?> |
|
| 221 | + <?php do_action('wpinv_discount_form_items', $discount); ?> |
|
| 222 | 222 | |
| 223 | - <?php do_action( 'wpinv_discount_form_before_excluded_items', $discount ); ?> |
|
| 223 | + <?php do_action('wpinv_discount_form_before_excluded_items', $discount); ?> |
|
| 224 | 224 | <div class="form-group mb-3 row"> |
| 225 | 225 | <label for="wpinv_discount_excluded_items" class="col-sm-3 col-form-label"> |
| 226 | - <?php esc_html_e( 'Excluded Items', 'invoicing' ); ?> |
|
| 226 | + <?php esc_html_e('Excluded Items', 'invoicing'); ?> |
|
| 227 | 227 | </label> |
| 228 | 228 | <div class="col-sm-8"> |
| 229 | 229 | <?php |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | array( |
| 232 | 232 | 'id' => 'wpinv_discount_excluded_items', |
| 233 | 233 | 'name' => 'wpinv_discount_excluded_items[]', |
| 234 | - 'label' => __( 'Excluded Items', 'invoicing' ), |
|
| 235 | - 'placeholder' => __( 'Select Items', 'invoicing' ), |
|
| 236 | - 'value' => $discount->get_excluded_items( 'edit' ), |
|
| 234 | + 'label' => __('Excluded Items', 'invoicing'), |
|
| 235 | + 'placeholder' => __('Select Items', 'invoicing'), |
|
| 236 | + 'value' => $discount->get_excluded_items('edit'), |
|
| 237 | 237 | 'select2' => true, |
| 238 | 238 | 'multiple' => true, |
| 239 | 239 | 'data-allow-clear' => 'false', |
@@ -244,15 +244,15 @@ discard block |
||
| 244 | 244 | ?> |
| 245 | 245 | </div> |
| 246 | 246 | <div class="col-sm-1 pt-2 pl-0"> |
| 247 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Select all the items that are not allowed to use this discount.', 'invoicing' ); ?>"></span> |
|
| 247 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Select all the items that are not allowed to use this discount.', 'invoicing'); ?>"></span> |
|
| 248 | 248 | </div> |
| 249 | 249 | </div> |
| 250 | - <?php do_action( 'wpinv_discount_form_excluded_items', $discount ); ?> |
|
| 250 | + <?php do_action('wpinv_discount_form_excluded_items', $discount); ?> |
|
| 251 | 251 | |
| 252 | - <?php do_action( 'wpinv_discount_form_before_required_items', $discount ); ?> |
|
| 252 | + <?php do_action('wpinv_discount_form_before_required_items', $discount); ?> |
|
| 253 | 253 | <div class="form-group mb-3 row"> |
| 254 | 254 | <label for="wpinv_discount_required_items" class="col-sm-3 col-form-label"> |
| 255 | - <?php esc_html_e( 'Required Items', 'invoicing' ); ?> |
|
| 255 | + <?php esc_html_e('Required Items', 'invoicing'); ?> |
|
| 256 | 256 | </label> |
| 257 | 257 | <div class="col-sm-8"> |
| 258 | 258 | <?php |
@@ -260,9 +260,9 @@ discard block |
||
| 260 | 260 | array( |
| 261 | 261 | 'id' => 'wpinv_discount_required_items', |
| 262 | 262 | 'name' => 'wpinv_discount_required_items[]', |
| 263 | - 'label' => __( 'Required Items', 'invoicing' ), |
|
| 264 | - 'placeholder' => __( 'Select Items', 'invoicing' ), |
|
| 265 | - 'value' => $discount->get_required_items( 'edit' ), |
|
| 263 | + 'label' => __('Required Items', 'invoicing'), |
|
| 264 | + 'placeholder' => __('Select Items', 'invoicing'), |
|
| 265 | + 'value' => $discount->get_required_items('edit'), |
|
| 266 | 266 | 'select2' => true, |
| 267 | 267 | 'multiple' => true, |
| 268 | 268 | 'data-allow-clear' => 'false', |
@@ -273,15 +273,15 @@ discard block |
||
| 273 | 273 | ?> |
| 274 | 274 | </div> |
| 275 | 275 | <div class="col-sm-1 pt-2 pl-0"> |
| 276 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Select all the items that are required to be in the cart before using this discount.', 'invoicing' ); ?>"></span> |
|
| 276 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Select all the items that are required to be in the cart before using this discount.', 'invoicing'); ?>"></span> |
|
| 277 | 277 | </div> |
| 278 | 278 | </div> |
| 279 | - <?php do_action( 'wpinv_discount_form_required_items', $discount ); ?> |
|
| 279 | + <?php do_action('wpinv_discount_form_required_items', $discount); ?> |
|
| 280 | 280 | |
| 281 | - <?php do_action( 'wpinv_discount_form_before_start', $discount ); ?> |
|
| 281 | + <?php do_action('wpinv_discount_form_before_start', $discount); ?> |
|
| 282 | 282 | <div class="form-group mb-3 row"> |
| 283 | 283 | <label for="wpinv_discount_start" class="col-sm-3 col-form-label"> |
| 284 | - <?php esc_html_e( 'Start Date', 'invoicing' ); ?> |
|
| 284 | + <?php esc_html_e('Start Date', 'invoicing'); ?> |
|
| 285 | 285 | </label> |
| 286 | 286 | <div class="col-sm-8"> |
| 287 | 287 | <?php |
@@ -290,10 +290,10 @@ discard block |
||
| 290 | 290 | 'type' => 'datepicker', |
| 291 | 291 | 'id' => 'wpinv_discount_start', |
| 292 | 292 | 'name' => 'wpinv_discount_start', |
| 293 | - 'label' => __( 'Start Date', 'invoicing' ), |
|
| 293 | + 'label' => __('Start Date', 'invoicing'), |
|
| 294 | 294 | 'placeholder' => 'YYYY-MM-DD 00:00', |
| 295 | 295 | 'class' => 'form-control-sm', |
| 296 | - 'value' => $discount->get_start_date( 'edit' ), |
|
| 296 | + 'value' => $discount->get_start_date('edit'), |
|
| 297 | 297 | 'extra_attributes' => array( |
| 298 | 298 | 'data-enable-time' => 'true', |
| 299 | 299 | 'data-time_24hr' => 'true', |
@@ -305,15 +305,15 @@ discard block |
||
| 305 | 305 | ?> |
| 306 | 306 | </div> |
| 307 | 307 | <div class="col-sm-1 pt-2 pl-0"> |
| 308 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'For no start date, leave blank. If entered, the discount can only be used after or on this date.', 'invoicing' ); ?>"></span> |
|
| 308 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('For no start date, leave blank. If entered, the discount can only be used after or on this date.', 'invoicing'); ?>"></span> |
|
| 309 | 309 | </div> |
| 310 | 310 | </div> |
| 311 | - <?php do_action( 'wpinv_discount_form_start', $discount ); ?> |
|
| 311 | + <?php do_action('wpinv_discount_form_start', $discount); ?> |
|
| 312 | 312 | |
| 313 | - <?php do_action( 'wpinv_discount_form_before_expiration', $discount ); ?> |
|
| 313 | + <?php do_action('wpinv_discount_form_before_expiration', $discount); ?> |
|
| 314 | 314 | <div class="form-group mb-3 row"> |
| 315 | 315 | <label for="wpinv_discount_expiration" class="col-sm-3 col-form-label"> |
| 316 | - <?php esc_html_e( 'Expiration Date', 'invoicing' ); ?> |
|
| 316 | + <?php esc_html_e('Expiration Date', 'invoicing'); ?> |
|
| 317 | 317 | </label> |
| 318 | 318 | <div class="col-sm-8"> |
| 319 | 319 | <?php |
@@ -322,10 +322,10 @@ discard block |
||
| 322 | 322 | 'type' => 'datepicker', |
| 323 | 323 | 'id' => 'wpinv_discount_expiration', |
| 324 | 324 | 'name' => 'wpinv_discount_expiration', |
| 325 | - 'label' => __( 'Expiration Date', 'invoicing' ), |
|
| 325 | + 'label' => __('Expiration Date', 'invoicing'), |
|
| 326 | 326 | 'placeholder' => 'YYYY-MM-DD 00:00', |
| 327 | 327 | 'class' => 'form-control-sm', |
| 328 | - 'value' => $discount->get_end_date( 'edit' ), |
|
| 328 | + 'value' => $discount->get_end_date('edit'), |
|
| 329 | 329 | 'extra_attributes' => array( |
| 330 | 330 | 'data-enable-time' => 'true', |
| 331 | 331 | 'data-time_24hr' => 'true', |
@@ -339,111 +339,111 @@ discard block |
||
| 339 | 339 | ?> |
| 340 | 340 | </div> |
| 341 | 341 | <div class="col-sm-1 pt-2 pl-0"> |
| 342 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the date after which the discount will expire.', 'invoicing' ); ?>"></span> |
|
| 342 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the date after which the discount will expire.', 'invoicing'); ?>"></span> |
|
| 343 | 343 | </div> |
| 344 | 344 | </div> |
| 345 | - <?php do_action( 'wpinv_discount_form_expiration', $discount ); ?> |
|
| 345 | + <?php do_action('wpinv_discount_form_expiration', $discount); ?> |
|
| 346 | 346 | |
| 347 | - <?php do_action( 'wpinv_discount_form_before_min_total', $discount ); ?> |
|
| 347 | + <?php do_action('wpinv_discount_form_before_min_total', $discount); ?> |
|
| 348 | 348 | <div class="form-group mb-3 row"> |
| 349 | 349 | <label for="wpinv_discount_min_total" class="col-sm-3 col-form-label"> |
| 350 | - <?php esc_html_e( 'Minimum Amount', 'invoicing' ); ?> |
|
| 350 | + <?php esc_html_e('Minimum Amount', 'invoicing'); ?> |
|
| 351 | 351 | </label> |
| 352 | 352 | <div class="col-sm-8"> |
| 353 | 353 | <div class="input-group input-group-sm"> |
| 354 | 354 | |
| 355 | - <?php if ( 'left' == $position ) : ?> |
|
| 356 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 355 | + <?php if ('left' == $position) : ?> |
|
| 356 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 357 | 357 | <div class="input-group-prepend"> |
| 358 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 358 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 359 | 359 | </div> |
| 360 | 360 | <?php else : ?> |
| 361 | 361 | <span class="input-group-text"> |
| 362 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 362 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 363 | 363 | </span> |
| 364 | 364 | <?php endif; ?> |
| 365 | 365 | <?php endif; ?> |
| 366 | 366 | |
| 367 | - <input type="text" name="wpinv_discount_min_total" id="wpinv_discount_min_total" value="<?php echo esc_attr( $discount->get_minimum_total( 'edit' ) ); ?>" placeholder="<?php esc_attr_e( 'No minimum', 'invoicing' ); ?>" class="form-control"> |
|
| 367 | + <input type="text" name="wpinv_discount_min_total" id="wpinv_discount_min_total" value="<?php echo esc_attr($discount->get_minimum_total('edit')); ?>" placeholder="<?php esc_attr_e('No minimum', 'invoicing'); ?>" class="form-control"> |
|
| 368 | 368 | |
| 369 | - <?php if ( 'left' != $position ) : ?> |
|
| 370 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 369 | + <?php if ('left' != $position) : ?> |
|
| 370 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 371 | 371 | <div class="input-group-append"> |
| 372 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 372 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 373 | 373 | </div> |
| 374 | 374 | <?php else : ?> |
| 375 | 375 | <span class="input-group-text"> |
| 376 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 376 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 377 | 377 | </span> |
| 378 | 378 | <?php endif; ?> |
| 379 | 379 | <?php endif; ?> |
| 380 | 380 | </div> |
| 381 | 381 | </div> |
| 382 | 382 | <div class="col-sm-1 pt-2 pl-0"> |
| 383 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the minimum amount (including taxes) required to use this discount.', 'invoicing' ); ?>"></span> |
|
| 383 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the minimum amount (including taxes) required to use this discount.', 'invoicing'); ?>"></span> |
|
| 384 | 384 | </div> |
| 385 | 385 | </div> |
| 386 | - <?php do_action( 'wpinv_discount_form_min_total', $discount ); ?> |
|
| 386 | + <?php do_action('wpinv_discount_form_min_total', $discount); ?> |
|
| 387 | 387 | |
| 388 | - <?php do_action( 'wpinv_discount_form_before_max_total', $discount ); ?> |
|
| 388 | + <?php do_action('wpinv_discount_form_before_max_total', $discount); ?> |
|
| 389 | 389 | <div class="form-group mb-3 row"> |
| 390 | 390 | <label for="wpinv_discount_max_total" class="col-sm-3 col-form-label"> |
| 391 | - <?php esc_html_e( 'Maximum Amount', 'invoicing' ); ?> |
|
| 391 | + <?php esc_html_e('Maximum Amount', 'invoicing'); ?> |
|
| 392 | 392 | </label> |
| 393 | 393 | <div class="col-sm-8"> |
| 394 | 394 | <div class="input-group input-group-sm"> |
| 395 | - <?php if ( 'left' == $position ) : ?> |
|
| 396 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 395 | + <?php if ('left' == $position) : ?> |
|
| 396 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 397 | 397 | <div class="input-group-prepend"> |
| 398 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 398 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 399 | 399 | </div> |
| 400 | 400 | <?php else : ?> |
| 401 | 401 | <span class="input-group-text"> |
| 402 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 402 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 403 | 403 | </span> |
| 404 | 404 | <?php endif; ?> |
| 405 | 405 | <?php endif; ?> |
| 406 | 406 | |
| 407 | - <input type="text" name="wpinv_discount_max_total" id="wpinv_discount_max_total" value="<?php echo esc_attr( $discount->get_maximum_total( 'edit' ) ); ?>" placeholder="<?php esc_attr_e( 'No maximum', 'invoicing' ); ?>" class="form-control"> |
|
| 407 | + <input type="text" name="wpinv_discount_max_total" id="wpinv_discount_max_total" value="<?php echo esc_attr($discount->get_maximum_total('edit')); ?>" placeholder="<?php esc_attr_e('No maximum', 'invoicing'); ?>" class="form-control"> |
|
| 408 | 408 | |
| 409 | - <?php if ( 'left' != $position ) : ?> |
|
| 410 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 409 | + <?php if ('left' != $position) : ?> |
|
| 410 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 411 | 411 | <div class="input-group-append"> |
| 412 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 412 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 413 | 413 | </div> |
| 414 | 414 | <?php else : ?> |
| 415 | 415 | <span class="input-group-text"> |
| 416 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 416 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 417 | 417 | </span> |
| 418 | 418 | <?php endif; ?> |
| 419 | 419 | <?php endif; ?> |
| 420 | 420 | </div> |
| 421 | 421 | </div> |
| 422 | 422 | <div class="col-sm-1 pt-2 pl-0"> |
| 423 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the maximum amount (including taxes) allowed when using this discount.', 'invoicing' ); ?>"></span> |
|
| 423 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the maximum amount (including taxes) allowed when using this discount.', 'invoicing'); ?>"></span> |
|
| 424 | 424 | </div> |
| 425 | 425 | </div> |
| 426 | - <?php do_action( 'wpinv_discount_form_before_max_total', $discount ); ?> |
|
| 426 | + <?php do_action('wpinv_discount_form_before_max_total', $discount); ?> |
|
| 427 | 427 | |
| 428 | - <?php do_action( 'wpinv_discount_form_before_max_uses', $discount ); ?> |
|
| 428 | + <?php do_action('wpinv_discount_form_before_max_uses', $discount); ?> |
|
| 429 | 429 | <div class="form-group mb-3 row"> |
| 430 | 430 | <label for="wpinv_discount_max_uses" class="col-sm-3 col-form-label"> |
| 431 | - <?php esc_html_e( 'Maximum Uses', 'invoicing' ); ?> |
|
| 431 | + <?php esc_html_e('Maximum Uses', 'invoicing'); ?> |
|
| 432 | 432 | </label> |
| 433 | 433 | <div class="col-sm-8"> |
| 434 | - <input type="text" value="<?php echo esc_attr( $discount->get_max_uses( 'edit' ) ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'invoicing' ); ?>" name="wpinv_discount_max_uses" id="wpinv_discount_max_uses" style="width: 100%;" /> |
|
| 434 | + <input type="text" value="<?php echo esc_attr($discount->get_max_uses('edit')); ?>" placeholder="<?php esc_attr_e('Unlimited', 'invoicing'); ?>" name="wpinv_discount_max_uses" id="wpinv_discount_max_uses" style="width: 100%;" /> |
|
| 435 | 435 | </div> |
| 436 | 436 | <div class="col-sm-1 pt-2 pl-0"> |
| 437 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the maximum number of times that this discount code can be used.', 'invoicing' ); ?>"></span> |
|
| 437 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the maximum number of times that this discount code can be used.', 'invoicing'); ?>"></span> |
|
| 438 | 438 | </div> |
| 439 | 439 | </div> |
| 440 | - <?php do_action( 'wpinv_discount_form_max_uses', $discount ); ?> |
|
| 440 | + <?php do_action('wpinv_discount_form_max_uses', $discount); ?> |
|
| 441 | 441 | |
| 442 | - <?php do_action( 'wpinv_discount_form_last', $discount ); ?> |
|
| 442 | + <?php do_action('wpinv_discount_form_last', $discount); ?> |
|
| 443 | 443 | |
| 444 | 444 | </div> |
| 445 | 445 | <?php |
| 446 | - do_action( 'wpinv_discount_form_bottom', $post ); |
|
| 446 | + do_action('wpinv_discount_form_bottom', $post); |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
@@ -451,31 +451,31 @@ discard block |
||
| 451 | 451 | * |
| 452 | 452 | * @param int $post_id |
| 453 | 453 | */ |
| 454 | - public static function save( $post_id ) { |
|
| 454 | + public static function save($post_id) { |
|
| 455 | 455 | |
| 456 | 456 | // Prepare the discount. |
| 457 | - $discount = new WPInv_Discount( $post_id ); |
|
| 457 | + $discount = new WPInv_Discount($post_id); |
|
| 458 | 458 | |
| 459 | 459 | // Load new data. |
| 460 | 460 | $discount->set_props( |
| 461 | 461 | array( |
| 462 | - 'code' => isset( $_POST['wpinv_discount_code'] ) ? wpinv_clean( $_POST['wpinv_discount_code'] ) : null, |
|
| 463 | - 'amount' => isset( $_POST['wpinv_discount_amount'] ) ? floatval( $_POST['wpinv_discount_amount'] ) : null, |
|
| 464 | - 'start' => isset( $_POST['wpinv_discount_start'] ) ? wpinv_clean( $_POST['wpinv_discount_start'] ) : null, |
|
| 465 | - 'expiration' => isset( $_POST['wpinv_discount_expiration'] ) ? wpinv_clean( $_POST['wpinv_discount_expiration'] ) : null, |
|
| 466 | - 'is_single_use' => ! empty( $_POST['wpinv_discount_single_use'] ), |
|
| 467 | - 'type' => isset( $_POST['wpinv_discount_type'] ) ? wpinv_clean( $_POST['wpinv_discount_type'] ) : null, |
|
| 468 | - 'is_recurring' => ! empty( $_POST['wpinv_discount_recurring'] ), |
|
| 469 | - 'items' => isset( $_POST['wpinv_discount_items'] ) ? wpinv_clean( $_POST['wpinv_discount_items'] ) : array(), |
|
| 470 | - 'excluded_items' => isset( $_POST['wpinv_discount_excluded_items'] ) ? wpinv_clean( $_POST['wpinv_discount_excluded_items'] ) : array(), |
|
| 471 | - 'required_items' => isset( $_POST['wpinv_discount_required_items'] ) ? wpinv_clean( $_POST['wpinv_discount_required_items'] ) : array(), |
|
| 472 | - 'max_uses' => isset( $_POST['wpinv_discount_max_uses'] ) ? intval( $_POST['wpinv_discount_max_uses'] ) : null, |
|
| 473 | - 'min_total' => isset( $_POST['wpinv_discount_min_total'] ) ? floatval( $_POST['wpinv_discount_min_total'] ) : null, |
|
| 474 | - 'max_total' => isset( $_POST['wpinv_discount_max_total'] ) ? floatval( $_POST['wpinv_discount_max_total'] ) : null, |
|
| 462 | + 'code' => isset($_POST['wpinv_discount_code']) ? wpinv_clean($_POST['wpinv_discount_code']) : null, |
|
| 463 | + 'amount' => isset($_POST['wpinv_discount_amount']) ? floatval($_POST['wpinv_discount_amount']) : null, |
|
| 464 | + 'start' => isset($_POST['wpinv_discount_start']) ? wpinv_clean($_POST['wpinv_discount_start']) : null, |
|
| 465 | + 'expiration' => isset($_POST['wpinv_discount_expiration']) ? wpinv_clean($_POST['wpinv_discount_expiration']) : null, |
|
| 466 | + 'is_single_use' => !empty($_POST['wpinv_discount_single_use']), |
|
| 467 | + 'type' => isset($_POST['wpinv_discount_type']) ? wpinv_clean($_POST['wpinv_discount_type']) : null, |
|
| 468 | + 'is_recurring' => !empty($_POST['wpinv_discount_recurring']), |
|
| 469 | + 'items' => isset($_POST['wpinv_discount_items']) ? wpinv_clean($_POST['wpinv_discount_items']) : array(), |
|
| 470 | + 'excluded_items' => isset($_POST['wpinv_discount_excluded_items']) ? wpinv_clean($_POST['wpinv_discount_excluded_items']) : array(), |
|
| 471 | + 'required_items' => isset($_POST['wpinv_discount_required_items']) ? wpinv_clean($_POST['wpinv_discount_required_items']) : array(), |
|
| 472 | + 'max_uses' => isset($_POST['wpinv_discount_max_uses']) ? intval($_POST['wpinv_discount_max_uses']) : null, |
|
| 473 | + 'min_total' => isset($_POST['wpinv_discount_min_total']) ? floatval($_POST['wpinv_discount_min_total']) : null, |
|
| 474 | + 'max_total' => isset($_POST['wpinv_discount_max_total']) ? floatval($_POST['wpinv_discount_max_total']) : null, |
|
| 475 | 475 | ) |
| 476 | 476 | ); |
| 477 | 477 | |
| 478 | 478 | $discount->save(); |
| 479 | - do_action( 'getpaid_discount_metabox_save', $post_id, $discount ); |
|
| 479 | + do_action('getpaid_discount_metabox_save', $post_id, $discount); |
|
| 480 | 480 | } |
| 481 | 481 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 10 | +if (!defined('ABSPATH')) { |
|
| 11 | 11 | exit; // Exit if accessed directly |
| 12 | 12 | } |
| 13 | 13 | |
@@ -21,27 +21,27 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @param WP_Post $post |
| 23 | 23 | */ |
| 24 | - public static function output( $post ) { |
|
| 24 | + public static function output($post) { |
|
| 25 | 25 | |
| 26 | 26 | // Prepare the item. |
| 27 | - $item = new WPInv_Item( $post ); |
|
| 27 | + $item = new WPInv_Item($post); |
|
| 28 | 28 | |
| 29 | 29 | // Nonce field. |
| 30 | - wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' ); |
|
| 30 | + wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce'); |
|
| 31 | 31 | |
| 32 | 32 | // Set the currency position. |
| 33 | 33 | $position = wpinv_currency_position(); |
| 34 | 34 | |
| 35 | - if ( $position == 'left_space' ) { |
|
| 35 | + if ($position == 'left_space') { |
|
| 36 | 36 | $position = 'left'; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if ( $position == 'right_space' ) { |
|
| 39 | + if ($position == 'right_space') { |
|
| 40 | 40 | $position = 'right'; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | ?> |
| 44 | - <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr( $item->get_type( 'edit' ) ); ?>" /> |
|
| 44 | + <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr($item->get_type('edit')); ?>" /> |
|
| 45 | 45 | <style> |
| 46 | 46 | #poststuff .input-group-text, |
| 47 | 47 | #poststuff .form-control { |
@@ -55,36 +55,36 @@ discard block |
||
| 55 | 55 | </style> |
| 56 | 56 | <div class='bsui' style='max-width: 600px;padding-top: 10px;'> |
| 57 | 57 | |
| 58 | - <?php do_action( 'wpinv_item_details_metabox_before_price', $item ); ?> |
|
| 58 | + <?php do_action('wpinv_item_details_metabox_before_price', $item); ?> |
|
| 59 | 59 | <div class="form-group mb-3 row"> |
| 60 | - <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php esc_html_e( 'Item Price', 'invoicing' ); ?></span></label> |
|
| 60 | + <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php esc_html_e('Item Price', 'invoicing'); ?></span></label> |
|
| 61 | 61 | <div class="col-sm-8"> |
| 62 | 62 | <div class="row"> |
| 63 | 63 | <div class="col-sm-4 getpaid-price-input"> |
| 64 | 64 | <div class="input-group input-group-sm"> |
| 65 | 65 | |
| 66 | - <?php if ( 'left' == $position ) : ?> |
|
| 67 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 66 | + <?php if ('left' == $position) : ?> |
|
| 67 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 68 | 68 | <div class="input-group-prepend"> |
| 69 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 69 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 70 | 70 | </div> |
| 71 | 71 | <?php else : ?> |
| 72 | 72 | <span class="input-group-text"> |
| 73 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 73 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 74 | 74 | </span> |
| 75 | 75 | <?php endif; ?> |
| 76 | 76 | <?php endif; ?> |
| 77 | 77 | |
| 78 | - <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr( getpaid_unstandardize_amount( $item->get_price( 'edit' ) ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control"> |
|
| 78 | + <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr(getpaid_unstandardize_amount($item->get_price('edit'))); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control"> |
|
| 79 | 79 | |
| 80 | - <?php if ( 'left' != $position ) : ?> |
|
| 81 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 80 | + <?php if ('left' != $position) : ?> |
|
| 81 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 82 | 82 | <div class="input-group-append"> |
| 83 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 83 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 84 | 84 | </div> |
| 85 | 85 | <?php else : ?> |
| 86 | 86 | <span class="input-group-text"> |
| 87 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 87 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 88 | 88 | </span> |
| 89 | 89 | <?php endif; ?> |
| 90 | 90 | <?php endif; ?> |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | </div> |
| 94 | 94 | <div class="col-sm-4 wpinv_show_if_recurring"> |
| 95 | 95 | <?php |
| 96 | - esc_html_e( 'every' ); |
|
| 96 | + esc_html_e('every'); |
|
| 97 | 97 | echo ' '; |
| 98 | 98 | ?> |
| 99 | - <input type="number" style="max-width: 60px;" value="<?php echo esc_attr( $item->get_recurring_interval( 'edit' ) ); ?>" placeholder="1" name="wpinv_recurring_interval" id="wpinv_recurring_interval" /> |
|
| 99 | + <input type="number" style="max-width: 60px;" value="<?php echo esc_attr($item->get_recurring_interval('edit')); ?>" placeholder="1" name="wpinv_recurring_interval" id="wpinv_recurring_interval" /> |
|
| 100 | 100 | </div> |
| 101 | 101 | <div class="col-sm-4 wpinv_show_if_recurring"> |
| 102 | 102 | <?php |
@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | array( |
| 105 | 105 | 'id' => 'wpinv_recurring_period', |
| 106 | 106 | 'name' => 'wpinv_recurring_period', |
| 107 | - 'label' => __( 'Period', 'invoicing' ), |
|
| 108 | - 'placeholder' => __( 'Select Period', 'invoicing' ), |
|
| 109 | - 'value' => $item->get_recurring_period( 'edit' ), |
|
| 107 | + 'label' => __('Period', 'invoicing'), |
|
| 108 | + 'placeholder' => __('Select Period', 'invoicing'), |
|
| 109 | + 'value' => $item->get_recurring_period('edit'), |
|
| 110 | 110 | 'select2' => true, |
| 111 | 111 | 'data-allow-clear' => 'false', |
| 112 | 112 | 'options' => array( |
| 113 | - 'D' => __( 'day(s)', 'invoicing' ), |
|
| 114 | - 'W' => __( 'week(s)', 'invoicing' ), |
|
| 115 | - 'M' => __( 'month(s)', 'invoicing' ), |
|
| 116 | - 'Y' => __( 'year(s)', 'invoicing' ), |
|
| 113 | + 'D' => __('day(s)', 'invoicing'), |
|
| 114 | + 'W' => __('week(s)', 'invoicing'), |
|
| 115 | + 'M' => __('month(s)', 'invoicing'), |
|
| 116 | + 'Y' => __('year(s)', 'invoicing'), |
|
| 117 | 117 | ), |
| 118 | 118 | ), |
| 119 | 119 | true |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | <?php |
| 127 | 127 | |
| 128 | 128 | // Dynamic pricing. |
| 129 | - if ( $item->supports_dynamic_pricing() ) { |
|
| 129 | + if ($item->supports_dynamic_pricing()) { |
|
| 130 | 130 | |
| 131 | - do_action( 'wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item ); |
|
| 131 | + do_action('wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item); |
|
| 132 | 132 | |
| 133 | 133 | // NYP toggle. |
| 134 | 134 | aui()->input( |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | 'id' => 'wpinv_name_your_price', |
| 137 | 137 | 'name' => 'wpinv_name_your_price', |
| 138 | 138 | 'type' => 'checkbox', |
| 139 | - 'label' => apply_filters( 'wpinv_name_your_price_toggle_text', __( 'Let customers name their price', 'invoicing' ) ), |
|
| 139 | + 'label' => apply_filters('wpinv_name_your_price_toggle_text', __('Let customers name their price', 'invoicing')), |
|
| 140 | 140 | 'value' => '1', |
| 141 | 141 | 'checked' => $item->user_can_set_their_price(), |
| 142 | 142 | 'no_wrap' => true, |
@@ -144,71 +144,71 @@ discard block |
||
| 144 | 144 | true |
| 145 | 145 | ); |
| 146 | 146 | |
| 147 | - do_action( 'wpinv_item_details_metabox_dynamic_pricing_checkbox', $item ); |
|
| 147 | + do_action('wpinv_item_details_metabox_dynamic_pricing_checkbox', $item); |
|
| 148 | 148 | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Subscriptions. |
| 152 | - do_action( 'wpinv_item_details_metabox_before_subscription_checkbox', $item ); |
|
| 152 | + do_action('wpinv_item_details_metabox_before_subscription_checkbox', $item); |
|
| 153 | 153 | aui()->input( |
| 154 | 154 | array( |
| 155 | 155 | 'id' => 'wpinv_is_recurring', |
| 156 | 156 | 'name' => 'wpinv_is_recurring', |
| 157 | 157 | 'type' => 'checkbox', |
| 158 | - 'label' => apply_filters( 'wpinv_is_recurring_toggle_text', __( 'Charge customers a recurring amount for this item', 'invoicing' ) ), |
|
| 158 | + 'label' => apply_filters('wpinv_is_recurring_toggle_text', __('Charge customers a recurring amount for this item', 'invoicing')), |
|
| 159 | 159 | 'value' => '1', |
| 160 | 160 | 'checked' => $item->is_recurring(), |
| 161 | 161 | 'no_wrap' => true, |
| 162 | 162 | ), |
| 163 | 163 | true |
| 164 | 164 | ); |
| 165 | - do_action( 'wpinv_item_details_metabox_subscription_checkbox', $item ); |
|
| 165 | + do_action('wpinv_item_details_metabox_subscription_checkbox', $item); |
|
| 166 | 166 | |
| 167 | 167 | ?> |
| 168 | 168 | <div class="wpinv_show_if_recurring"> |
| 169 | - <em><?php echo wp_kses_post( wpinv_get_recurring_gateways_text() ); ?></em> |
|
| 169 | + <em><?php echo wp_kses_post(wpinv_get_recurring_gateways_text()); ?></em> |
|
| 170 | 170 | </div> |
| 171 | 171 | </div> |
| 172 | 172 | </div> |
| 173 | 173 | </div> |
| 174 | 174 | <div class="col-sm-1 pt-2 pl-0"> |
| 175 | - <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e( 'Set the subscription price, billing interval and period.', 'invoicing' ); ?>"></span> |
|
| 175 | + <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e('Set the subscription price, billing interval and period.', 'invoicing'); ?>"></span> |
|
| 176 | 176 | </div> |
| 177 | 177 | </div> |
| 178 | - <?php do_action( 'wpinv_item_details_metabox_after_price', $item ); ?> |
|
| 178 | + <?php do_action('wpinv_item_details_metabox_after_price', $item); ?> |
|
| 179 | 179 | |
| 180 | - <?php if ( $item->supports_dynamic_pricing() ) : ?> |
|
| 181 | - <?php do_action( 'wpinv_item_details_metabox_before_minimum_price', $item ); ?> |
|
| 180 | + <?php if ($item->supports_dynamic_pricing()) : ?> |
|
| 181 | + <?php do_action('wpinv_item_details_metabox_before_minimum_price', $item); ?> |
|
| 182 | 182 | <div class="wpinv_show_if_dynamic wpinv_minimum_price"> |
| 183 | 183 | |
| 184 | 184 | <div class="form-group mb-3 row"> |
| 185 | 185 | <label for="wpinv_minimum_price" class="col-sm-3 col-form-label"> |
| 186 | - <?php esc_html_e( 'Minimum Price', 'invoicing' ); ?> |
|
| 186 | + <?php esc_html_e('Minimum Price', 'invoicing'); ?> |
|
| 187 | 187 | </label> |
| 188 | 188 | <div class="col-sm-8"> |
| 189 | 189 | <div class="input-group input-group-sm"> |
| 190 | - <?php if ( 'left' == $position ) : ?> |
|
| 191 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 190 | + <?php if ('left' == $position) : ?> |
|
| 191 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 192 | 192 | <div class="input-group-prepend"> |
| 193 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 193 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 194 | 194 | </div> |
| 195 | 195 | <?php else : ?> |
| 196 | 196 | <span class="input-group-text"> |
| 197 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 197 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 198 | 198 | </span> |
| 199 | 199 | <?php endif; ?> |
| 200 | 200 | <?php endif; ?> |
| 201 | 201 | |
| 202 | - <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr( getpaid_unstandardize_amount( $item->get_minimum_price( 'edit' ) ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control"> |
|
| 202 | + <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr(getpaid_unstandardize_amount($item->get_minimum_price('edit'))); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control"> |
|
| 203 | 203 | |
| 204 | - <?php if ( 'left' != $position ) : ?> |
|
| 205 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 204 | + <?php if ('left' != $position) : ?> |
|
| 205 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 206 | 206 | <div class="input-group-append"> |
| 207 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 207 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 208 | 208 | </div> |
| 209 | 209 | <?php else : ?> |
| 210 | 210 | <span class="input-group-text"> |
| 211 | - <?php echo wp_kses_post( wpinv_currency_symbol() ); ?> |
|
| 211 | + <?php echo wp_kses_post(wpinv_currency_symbol()); ?> |
|
| 212 | 212 | </span> |
| 213 | 213 | <?php endif; ?> |
| 214 | 214 | <?php endif; ?> |
@@ -216,45 +216,45 @@ discard block |
||
| 216 | 216 | </div> |
| 217 | 217 | |
| 218 | 218 | <div class="col-sm-1 pt-2 pl-0"> |
| 219 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter the minimum amount that users are allowed to set', 'invoicing' ); ?>"></span> |
|
| 219 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter the minimum amount that users are allowed to set', 'invoicing'); ?>"></span> |
|
| 220 | 220 | </div> |
| 221 | 221 | </div> |
| 222 | 222 | |
| 223 | 223 | </div> |
| 224 | - <?php do_action( 'wpinv_item_details_metabox_minimum_price', $item ); ?> |
|
| 224 | + <?php do_action('wpinv_item_details_metabox_minimum_price', $item); ?> |
|
| 225 | 225 | <?php endif; ?> |
| 226 | 226 | |
| 227 | - <?php do_action( 'wpinv_item_details_metabox_before_maximum_renewals', $item ); ?> |
|
| 227 | + <?php do_action('wpinv_item_details_metabox_before_maximum_renewals', $item); ?> |
|
| 228 | 228 | <div class="wpinv_show_if_recurring wpinv_maximum_renewals"> |
| 229 | 229 | |
| 230 | 230 | <div class="form-group mb-3 row"> |
| 231 | 231 | <label for="wpinv_recurring_limit" class="col-sm-3 col-form-label"> |
| 232 | - <?php esc_html_e( 'Maximum Renewals', 'invoicing' ); ?> |
|
| 232 | + <?php esc_html_e('Maximum Renewals', 'invoicing'); ?> |
|
| 233 | 233 | </label> |
| 234 | 234 | <div class="col-sm-8"> |
| 235 | - <input type="number" value="<?php echo esc_attr( $item->get_recurring_limit( 'edit' ) ); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" /> |
|
| 235 | + <input type="number" value="<?php echo esc_attr($item->get_recurring_limit('edit')); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" /> |
|
| 236 | 236 | </div> |
| 237 | 237 | <div class="col-sm-1 pt-2 pl-0"> |
| 238 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing' ); ?>"></span> |
|
| 238 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing'); ?>"></span> |
|
| 239 | 239 | </div> |
| 240 | 240 | </div> |
| 241 | 241 | |
| 242 | 242 | </div> |
| 243 | - <?php do_action( 'wpinv_item_details_metabox_maximum_renewals', $item ); ?> |
|
| 243 | + <?php do_action('wpinv_item_details_metabox_maximum_renewals', $item); ?> |
|
| 244 | 244 | |
| 245 | - <?php do_action( 'wpinv_item_details_metabox_before_free_trial', $item ); ?> |
|
| 245 | + <?php do_action('wpinv_item_details_metabox_before_free_trial', $item); ?> |
|
| 246 | 246 | <div class="wpinv_show_if_recurring wpinv_free_trial"> |
| 247 | 247 | |
| 248 | 248 | <div class="form-group mb-3 row"> |
| 249 | - <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php defined( 'GETPAID_PAID_TRIALS_VERSION' ) ? esc_html_e( 'Free/Paid Trial', 'invoicing' ) : esc_html_e( 'Free Trial', 'invoicing' ); ?></label> |
|
| 249 | + <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php defined('GETPAID_PAID_TRIALS_VERSION') ? esc_html_e('Free/Paid Trial', 'invoicing') : esc_html_e('Free Trial', 'invoicing'); ?></label> |
|
| 250 | 250 | |
| 251 | 251 | <div class="col-sm-8"> |
| 252 | 252 | <div class="row"> |
| 253 | 253 | <div class="col-sm-6"> |
| 254 | - <?php $value = $item->has_free_trial() ? $item->get_trial_interval( 'edit' ) : 0; ?> |
|
| 254 | + <?php $value = $item->has_free_trial() ? $item->get_trial_interval('edit') : 0; ?> |
|
| 255 | 255 | |
| 256 | 256 | <div> |
| 257 | - <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr( $value ); ?>" > |
|
| 257 | + <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr($value); ?>" > |
|
| 258 | 258 | </div> |
| 259 | 259 | </div> |
| 260 | 260 | <div class="col-sm-6"> |
@@ -263,17 +263,17 @@ discard block |
||
| 263 | 263 | array( |
| 264 | 264 | 'id' => 'wpinv_trial_period', |
| 265 | 265 | 'name' => 'wpinv_trial_period', |
| 266 | - 'label' => __( 'Trial Period', 'invoicing' ), |
|
| 267 | - 'placeholder' => __( 'Trial Period', 'invoicing' ), |
|
| 268 | - 'value' => $item->get_trial_period( 'edit' ), |
|
| 266 | + 'label' => __('Trial Period', 'invoicing'), |
|
| 267 | + 'placeholder' => __('Trial Period', 'invoicing'), |
|
| 268 | + 'value' => $item->get_trial_period('edit'), |
|
| 269 | 269 | 'select2' => true, |
| 270 | 270 | 'data-allow-clear' => 'false', |
| 271 | 271 | 'no_wrap' => true, |
| 272 | 272 | 'options' => array( |
| 273 | - 'D' => __( 'day(s)', 'invoicing' ), |
|
| 274 | - 'W' => __( 'week(s)', 'invoicing' ), |
|
| 275 | - 'M' => __( 'month(s)', 'invoicing' ), |
|
| 276 | - 'Y' => __( 'year(s)', 'invoicing' ), |
|
| 273 | + 'D' => __('day(s)', 'invoicing'), |
|
| 274 | + 'W' => __('week(s)', 'invoicing'), |
|
| 275 | + 'M' => __('month(s)', 'invoicing'), |
|
| 276 | + 'Y' => __('year(s)', 'invoicing'), |
|
| 277 | 277 | ), |
| 278 | 278 | ), |
| 279 | 279 | true |
@@ -285,15 +285,15 @@ discard block |
||
| 285 | 285 | </div> |
| 286 | 286 | |
| 287 | 287 | <div class="col-sm-1 pt-2 pl-0"> |
| 288 | - <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'An optional period of time to wait before charging the first recurring payment.', 'invoicing' ); ?>"></span> |
|
| 288 | + <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('An optional period of time to wait before charging the first recurring payment.', 'invoicing'); ?>"></span> |
|
| 289 | 289 | </div> |
| 290 | 290 | |
| 291 | 291 | </div> |
| 292 | 292 | |
| 293 | 293 | </div> |
| 294 | - <?php do_action( 'wpinv_item_details_metabox__free_trial', $item ); ?> |
|
| 294 | + <?php do_action('wpinv_item_details_metabox__free_trial', $item); ?> |
|
| 295 | 295 | |
| 296 | - <?php do_action( 'wpinv_item_details_metabox_item_details', $item ); ?> |
|
| 296 | + <?php do_action('wpinv_item_details_metabox_item_details', $item); ?> |
|
| 297 | 297 | </div> |
| 298 | 298 | <?php |
| 299 | 299 | |
@@ -304,31 +304,31 @@ discard block |
||
| 304 | 304 | * |
| 305 | 305 | * @param int $post_id |
| 306 | 306 | */ |
| 307 | - public static function save( $post_id ) { |
|
| 307 | + public static function save($post_id) { |
|
| 308 | 308 | |
| 309 | 309 | // Prepare the item. |
| 310 | - $item = new WPInv_Item( $post_id ); |
|
| 310 | + $item = new WPInv_Item($post_id); |
|
| 311 | 311 | |
| 312 | 312 | // Load new data. |
| 313 | 313 | $item->set_props( |
| 314 | 314 | array( |
| 315 | - 'price' => isset( $_POST['wpinv_item_price'] ) ? getpaid_standardize_amount( $_POST['wpinv_item_price'] ) : null, |
|
| 316 | - 'vat_rule' => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null, |
|
| 317 | - 'vat_class' => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null, |
|
| 318 | - 'type' => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null, |
|
| 319 | - 'is_dynamic_pricing' => ! empty( $_POST['wpinv_name_your_price'] ), |
|
| 320 | - 'minimum_price' => isset( $_POST['wpinv_minimum_price'] ) ? getpaid_standardize_amount( $_POST['wpinv_minimum_price'] ) : null, |
|
| 321 | - 'is_recurring' => ! empty( $_POST['wpinv_is_recurring'] ), |
|
| 322 | - 'recurring_period' => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null, |
|
| 323 | - 'recurring_interval' => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : 1, |
|
| 324 | - 'recurring_limit' => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null, |
|
| 325 | - 'is_free_trial' => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null, |
|
| 326 | - 'trial_period' => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null, |
|
| 327 | - 'trial_interval' => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null, |
|
| 315 | + 'price' => isset($_POST['wpinv_item_price']) ? getpaid_standardize_amount($_POST['wpinv_item_price']) : null, |
|
| 316 | + 'vat_rule' => isset($_POST['wpinv_vat_rules']) ? wpinv_clean($_POST['wpinv_vat_rules']) : null, |
|
| 317 | + 'vat_class' => isset($_POST['wpinv_vat_class']) ? wpinv_clean($_POST['wpinv_vat_class']) : null, |
|
| 318 | + 'type' => isset($_POST['wpinv_item_type']) ? wpinv_clean($_POST['wpinv_item_type']) : null, |
|
| 319 | + 'is_dynamic_pricing' => !empty($_POST['wpinv_name_your_price']), |
|
| 320 | + 'minimum_price' => isset($_POST['wpinv_minimum_price']) ? getpaid_standardize_amount($_POST['wpinv_minimum_price']) : null, |
|
| 321 | + 'is_recurring' => !empty($_POST['wpinv_is_recurring']), |
|
| 322 | + 'recurring_period' => isset($_POST['wpinv_recurring_period']) ? wpinv_clean($_POST['wpinv_recurring_period']) : null, |
|
| 323 | + 'recurring_interval' => isset($_POST['wpinv_recurring_interval']) ? (int) $_POST['wpinv_recurring_interval'] : 1, |
|
| 324 | + 'recurring_limit' => isset($_POST['wpinv_recurring_limit']) ? (int) $_POST['wpinv_recurring_limit'] : null, |
|
| 325 | + 'is_free_trial' => isset($_POST['wpinv_trial_interval']) ? (0 != (int) $_POST['wpinv_trial_interval']) : null, |
|
| 326 | + 'trial_period' => isset($_POST['wpinv_trial_period']) ? wpinv_clean($_POST['wpinv_trial_period']) : null, |
|
| 327 | + 'trial_interval' => isset($_POST['wpinv_trial_interval']) ? (int) $_POST['wpinv_trial_interval'] : null, |
|
| 328 | 328 | ) |
| 329 | 329 | ); |
| 330 | 330 | |
| 331 | 331 | $item->save(); |
| 332 | - do_action( 'getpaid_item_metabox_save', $post_id, $item ); |
|
| 332 | + do_action('getpaid_item_metabox_save', $post_id, $item); |
|
| 333 | 333 | } |
| 334 | 334 | } |
@@ -7,16 +7,16 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Set the currency position. |
| 13 | 13 | $position = wpinv_currency_position(); |
| 14 | 14 | |
| 15 | -if ( $position == 'left_space' ) { |
|
| 15 | +if ($position == 'left_space') { |
|
| 16 | 16 | $position = 'left'; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if ( $position == 'right_space' ) { |
|
| 19 | +if ($position == 'right_space') { |
|
| 20 | 20 | $position = 'right'; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -26,25 +26,25 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | <div class="input-group"> |
| 28 | 28 | |
| 29 | - <?php if ( $position == 'left' ) : ?> |
|
| 30 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 29 | + <?php if ($position == 'left') : ?> |
|
| 30 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 31 | 31 | <div class="input-group-prepend "> |
| 32 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 32 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 33 | 33 | </div> |
| 34 | 34 | <?php else : ?> |
| 35 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 35 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 36 | 36 | <?php endif; ?> |
| 37 | 37 | <?php endif; ?> |
| 38 | 38 | |
| 39 | 39 | <input :placeholder='form_element.placeholder' class='form-control' type='text'> |
| 40 | 40 | |
| 41 | - <?php if ( $position == 'right' ) : ?> |
|
| 42 | - <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?> |
|
| 41 | + <?php if ($position == 'right') : ?> |
|
| 42 | + <?php if (empty($GLOBALS['aui_bs5'])) : ?> |
|
| 43 | 43 | <div class="input-group-append "> |
| 44 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 44 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 45 | 45 | </div> |
| 46 | 46 | <?php else : ?> |
| 47 | - <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span> |
|
| 47 | + <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span> |
|
| 48 | 48 | <?php endif; ?> |
| 49 | 49 | <?php endif; ?> |
| 50 | 50 | </div> |
@@ -7,13 +7,13 @@ |
||
| 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 class='wpinv-address-wrapper row'> |
| 15 | 15 | |
| 16 | - <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php esc_html_e( 'Billing / Shipping Address', 'invoicing' ); ?></h4> |
|
| 16 | + <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php esc_html_e('Billing / Shipping Address', 'invoicing'); ?></h4> |
|
| 17 | 17 | |
| 18 | 18 | <div class='form-group mb-3 address-field-preview wpinv-payment-form-field-preview' v-for='(field, index) in visible_fields( form_element.fields )' :class='grid_class( field )' :key='field.name'> |
| 19 | 19 | <label class="form-label d-block w-100"> |
@@ -7,49 +7,49 @@ |
||
| 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 class='form-group mb-3'> |
| 15 | 15 | <label class="form-label d-block"> |
| 16 | - <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span> |
|
| 16 | + <span><?php esc_html_e('Field Label', 'invoicing'); ?></span> |
|
| 17 | 17 | <input v-model='active_form_element.label' class='form-control' type="text"/> |
| 18 | 18 | </label> |
| 19 | 19 | </div> |
| 20 | 20 | |
| 21 | 21 | <div class='form-group mb-3'> |
| 22 | 22 | <label class="form-label d-block"> |
| 23 | - <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span> |
|
| 23 | + <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span> |
|
| 24 | 24 | <input v-model='active_form_element.placeholder' class='form-control' type="text"/> |
| 25 | 25 | </label> |
| 26 | 26 | </div> |
| 27 | 27 | |
| 28 | 28 | <div class='form-group mb-3'> |
| 29 | 29 | <label class="form-label d-block"> |
| 30 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
| 31 | - <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea> |
|
| 32 | - <small class="form-text text-muted"><?php esc_html_e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
| 30 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
| 31 | + <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea> |
|
| 32 | + <small class="form-text text-muted"><?php esc_html_e('HTML is allowed', 'invoicing'); ?></small> |
|
| 33 | 33 | </label> |
| 34 | 34 | </div> |
| 35 | 35 | |
| 36 | 36 | <div class='form-group mb-3 form-check'> |
| 37 | 37 | <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' /> |
| 38 | - <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label> |
|
| 38 | + <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label> |
|
| 39 | 39 | </div> |
| 40 | 40 | |
| 41 | 41 | <div class='form-group mb-3 form-check'> |
| 42 | 42 | <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' /> |
| 43 | - <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label> |
|
| 43 | + <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label> |
|
| 44 | 44 | </div> |
| 45 | 45 | |
| 46 | 46 | <hr class='featurette-divider mt-4'> |
| 47 | 47 | |
| 48 | 48 | <div class='form-group mb-3'> |
| 49 | 49 | <label class="form-label d-block"> |
| 50 | - <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span> |
|
| 50 | + <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span> |
|
| 51 | 51 | <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" /> |
| 52 | - <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span> |
|
| 52 | + <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span> |
|
| 53 | 53 | </label> |
| 54 | 54 | </div> |
| 55 | 55 | |