@@ -36,36 +36,36 @@ discard block |
||
| 36 | 36 | 'desc_tip' => true, |
| 37 | 37 | 'default' => '', |
| 38 | 38 | 'advanced' => false, |
| 39 | - ), |
|
| 39 | + ), |
|
| 40 | 40 | |
| 41 | 41 | 'form' => array( |
| 42 | - 'title' => __( 'Form', 'invoicing' ), |
|
| 43 | - 'desc' => __( 'Enter a form id in case you want to display a specific payment form', 'invoicing' ), |
|
| 44 | - 'type' => 'text', |
|
| 45 | - 'desc_tip' => true, |
|
| 46 | - 'default' => '', |
|
| 47 | - 'placeholder' => __( '1', 'invoicing' ), |
|
| 48 | - 'advanced' => false, |
|
| 49 | - ), |
|
| 50 | - |
|
| 51 | - 'item' => array( |
|
| 52 | - 'title' => __( 'Items', 'invoicing' ), |
|
| 53 | - 'desc' => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2. This will be ignored in case you specify a form above. Enter 0 as the quantity to let users select their own quantities', 'invoicing' ), |
|
| 54 | - 'type' => 'text', |
|
| 55 | - 'desc_tip' => true, |
|
| 56 | - 'default' => '', |
|
| 57 | - 'placeholder' => __( '1', 'invoicing' ), |
|
| 58 | - 'advanced' => false, |
|
| 59 | - ), |
|
| 42 | + 'title' => __( 'Form', 'invoicing' ), |
|
| 43 | + 'desc' => __( 'Enter a form id in case you want to display a specific payment form', 'invoicing' ), |
|
| 44 | + 'type' => 'text', |
|
| 45 | + 'desc_tip' => true, |
|
| 46 | + 'default' => '', |
|
| 47 | + 'placeholder' => __( '1', 'invoicing' ), |
|
| 48 | + 'advanced' => false, |
|
| 49 | + ), |
|
| 50 | + |
|
| 51 | + 'item' => array( |
|
| 52 | + 'title' => __( 'Items', 'invoicing' ), |
|
| 53 | + 'desc' => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2. This will be ignored in case you specify a form above. Enter 0 as the quantity to let users select their own quantities', 'invoicing' ), |
|
| 54 | + 'type' => 'text', |
|
| 55 | + 'desc_tip' => true, |
|
| 56 | + 'default' => '', |
|
| 57 | + 'placeholder' => __( '1', 'invoicing' ), |
|
| 58 | + 'advanced' => false, |
|
| 59 | + ), |
|
| 60 | 60 | |
| 61 | 61 | 'button' => array( |
| 62 | - 'title' => __( 'Button', 'invoicing' ), |
|
| 63 | - 'desc' => __( 'Enter button label in case you would like to display the forms in a popup.', 'invoicing' ), |
|
| 64 | - 'type' => 'text', |
|
| 65 | - 'desc_tip' => true, |
|
| 66 | - 'default' => '', |
|
| 67 | - 'advanced' => false, |
|
| 68 | - ), |
|
| 62 | + 'title' => __( 'Button', 'invoicing' ), |
|
| 63 | + 'desc' => __( 'Enter button label in case you would like to display the forms in a popup.', 'invoicing' ), |
|
| 64 | + 'type' => 'text', |
|
| 65 | + 'desc_tip' => true, |
|
| 66 | + 'default' => '', |
|
| 67 | + 'advanced' => false, |
|
| 68 | + ), |
|
| 69 | 69 | |
| 70 | 70 | ), |
| 71 | 71 | |
@@ -74,96 +74,96 @@ discard block |
||
| 74 | 74 | parent::__construct( $options ); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * The Super block output function. |
|
| 79 | - * |
|
| 80 | - * @param array $args |
|
| 81 | - * @param array $widget_args |
|
| 82 | - * @param string $content |
|
| 83 | - * |
|
| 84 | - * @return string |
|
| 85 | - */ |
|
| 77 | + /** |
|
| 78 | + * The Super block output function. |
|
| 79 | + * |
|
| 80 | + * @param array $args |
|
| 81 | + * @param array $widget_args |
|
| 82 | + * @param string $content |
|
| 83 | + * |
|
| 84 | + * @return string |
|
| 85 | + */ |
|
| 86 | 86 | public function output( $args = array(), $widget_args = array(), $content = '' ) { |
| 87 | 87 | |
| 88 | - // Is the shortcode set up correctly? |
|
| 89 | - if ( empty( $args['form'] ) && empty( $args['item'] ) ) { |
|
| 90 | - return aui()->alert( |
|
| 91 | - array( |
|
| 92 | - 'type' => 'warning', |
|
| 93 | - 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
| 94 | - ) |
|
| 95 | - ); |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - // Payment form or button? |
|
| 99 | - if ( ! empty( $args['form'] ) ) { |
|
| 100 | - return $this->handle_payment_form( $args ); |
|
| 101 | - } else { |
|
| 102 | - return $this->handle_buy_item( $args ); |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Displaying a payment form |
|
| 109 | - * |
|
| 110 | - * @return string |
|
| 111 | - */ |
|
| 88 | + // Is the shortcode set up correctly? |
|
| 89 | + if ( empty( $args['form'] ) && empty( $args['item'] ) ) { |
|
| 90 | + return aui()->alert( |
|
| 91 | + array( |
|
| 92 | + 'type' => 'warning', |
|
| 93 | + 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
| 94 | + ) |
|
| 95 | + ); |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + // Payment form or button? |
|
| 99 | + if ( ! empty( $args['form'] ) ) { |
|
| 100 | + return $this->handle_payment_form( $args ); |
|
| 101 | + } else { |
|
| 102 | + return $this->handle_buy_item( $args ); |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Displaying a payment form |
|
| 109 | + * |
|
| 110 | + * @return string |
|
| 111 | + */ |
|
| 112 | 112 | protected function handle_payment_form( $args = array() ) { |
| 113 | 113 | |
| 114 | - if ( empty( $args['button'] ) ) { |
|
| 115 | - ob_start(); |
|
| 116 | - getpaid_display_payment_form( $args['form'] ); |
|
| 117 | - return ob_get_clean(); |
|
| 118 | - } |
|
| 114 | + if ( empty( $args['button'] ) ) { |
|
| 115 | + ob_start(); |
|
| 116 | + getpaid_display_payment_form( $args['form'] ); |
|
| 117 | + return ob_get_clean(); |
|
| 118 | + } |
|
| 119 | 119 | |
| 120 | - return $this->payment_form_button( $args['form'], $args['button'] ); |
|
| 121 | - } |
|
| 120 | + return $this->payment_form_button( $args['form'], $args['button'] ); |
|
| 121 | + } |
|
| 122 | 122 | |
| 123 | - /** |
|
| 124 | - * Displays a payment form button. |
|
| 125 | - * |
|
| 126 | - * @return string |
|
| 127 | - */ |
|
| 123 | + /** |
|
| 124 | + * Displays a payment form button. |
|
| 125 | + * |
|
| 126 | + * @return string |
|
| 127 | + */ |
|
| 128 | 128 | protected function payment_form_button( $form, $button ) { |
| 129 | - return getpaid_get_payment_button( $button, $form ); |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * Selling an item |
|
| 134 | - * |
|
| 135 | - * @return string |
|
| 136 | - */ |
|
| 129 | + return getpaid_get_payment_button( $button, $form ); |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * Selling an item |
|
| 134 | + * |
|
| 135 | + * @return string |
|
| 136 | + */ |
|
| 137 | 137 | protected function handle_buy_item( $args = array() ) { |
| 138 | 138 | |
| 139 | - if ( empty( $args['button'] ) ) { |
|
| 140 | - return $this->buy_item_form( $args['item'] ); |
|
| 141 | - } |
|
| 139 | + if ( empty( $args['button'] ) ) { |
|
| 140 | + return $this->buy_item_form( $args['item'] ); |
|
| 141 | + } |
|
| 142 | 142 | |
| 143 | - return $this->buy_item_button( $args['item'], $args['button'] ); |
|
| 143 | + return $this->buy_item_button( $args['item'], $args['button'] ); |
|
| 144 | 144 | |
| 145 | - } |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * Displays a buy item form. |
|
| 149 | - * |
|
| 150 | - * @return string |
|
| 151 | - */ |
|
| 147 | + /** |
|
| 148 | + * Displays a buy item form. |
|
| 149 | + * |
|
| 150 | + * @return string |
|
| 151 | + */ |
|
| 152 | 152 | protected function buy_item_form( $item ) { |
| 153 | - $items = getpaid_convert_items_to_array( $item ); |
|
| 154 | - ob_start(); |
|
| 155 | - getpaid_display_item_payment_form( $items ); |
|
| 156 | - return ob_get_clean(); |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * Displays a buy item button. |
|
| 161 | - * |
|
| 162 | - * @return string |
|
| 163 | - */ |
|
| 153 | + $items = getpaid_convert_items_to_array( $item ); |
|
| 154 | + ob_start(); |
|
| 155 | + getpaid_display_item_payment_form( $items ); |
|
| 156 | + return ob_get_clean(); |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * Displays a buy item button. |
|
| 161 | + * |
|
| 162 | + * @return string |
|
| 163 | + */ |
|
| 164 | 164 | protected function buy_item_button( $item, $button ) { |
| 165 | - $button = getpaid_get_payment_button( $button, null, $item ); |
|
| 166 | - return apply_filters( 'getpaid_buy_item_button_widget', $button, $item ); |
|
| 165 | + $button = getpaid_get_payment_button( $button, null, $item ); |
|
| 166 | + return apply_filters( 'getpaid_buy_item_button_widget', $button, $item ); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if (!defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | |
@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | 'block-keywords' => "['invoicing','buy', 'buy item', 'form']", |
| 23 | 23 | 'class_name' => __CLASS__, |
| 24 | 24 | 'base_id' => 'getpaid', |
| 25 | - 'name' => __( 'GetPaid', 'invoicing' ), |
|
| 25 | + 'name' => __('GetPaid', 'invoicing'), |
|
| 26 | 26 | 'widget_ops' => array( |
| 27 | 27 | 'classname' => 'getpaid bsui', |
| 28 | - 'description' => esc_html__( 'Show payment forms or buttons.', 'invoicing' ), |
|
| 28 | + 'description' => esc_html__('Show payment forms or buttons.', 'invoicing'), |
|
| 29 | 29 | ), |
| 30 | 30 | 'arguments' => array( |
| 31 | 31 | |
| 32 | 32 | 'title' => array( |
| 33 | - 'title' => __( 'Widget title', 'invoicing' ), |
|
| 34 | - 'desc' => __( 'Enter widget title.', 'invoicing' ), |
|
| 33 | + 'title' => __('Widget title', 'invoicing'), |
|
| 34 | + 'desc' => __('Enter widget title.', 'invoicing'), |
|
| 35 | 35 | 'type' => 'text', |
| 36 | 36 | 'desc_tip' => true, |
| 37 | 37 | 'default' => '', |
@@ -39,28 +39,28 @@ discard block |
||
| 39 | 39 | ), |
| 40 | 40 | |
| 41 | 41 | 'form' => array( |
| 42 | - 'title' => __( 'Form', 'invoicing' ), |
|
| 43 | - 'desc' => __( 'Enter a form id in case you want to display a specific payment form', 'invoicing' ), |
|
| 42 | + 'title' => __('Form', 'invoicing'), |
|
| 43 | + 'desc' => __('Enter a form id in case you want to display a specific payment form', 'invoicing'), |
|
| 44 | 44 | 'type' => 'text', |
| 45 | 45 | 'desc_tip' => true, |
| 46 | 46 | 'default' => '', |
| 47 | - 'placeholder' => __( '1', 'invoicing' ), |
|
| 47 | + 'placeholder' => __('1', 'invoicing'), |
|
| 48 | 48 | 'advanced' => false, |
| 49 | 49 | ), |
| 50 | 50 | |
| 51 | 51 | 'item' => array( |
| 52 | - 'title' => __( 'Items', 'invoicing' ), |
|
| 53 | - 'desc' => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2. This will be ignored in case you specify a form above. Enter 0 as the quantity to let users select their own quantities', 'invoicing' ), |
|
| 52 | + 'title' => __('Items', 'invoicing'), |
|
| 53 | + 'desc' => __('Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2. This will be ignored in case you specify a form above. Enter 0 as the quantity to let users select their own quantities', 'invoicing'), |
|
| 54 | 54 | 'type' => 'text', |
| 55 | 55 | 'desc_tip' => true, |
| 56 | 56 | 'default' => '', |
| 57 | - 'placeholder' => __( '1', 'invoicing' ), |
|
| 57 | + 'placeholder' => __('1', 'invoicing'), |
|
| 58 | 58 | 'advanced' => false, |
| 59 | 59 | ), |
| 60 | 60 | |
| 61 | 61 | 'button' => array( |
| 62 | - 'title' => __( 'Button', 'invoicing' ), |
|
| 63 | - 'desc' => __( 'Enter button label in case you would like to display the forms in a popup.', 'invoicing' ), |
|
| 62 | + 'title' => __('Button', 'invoicing'), |
|
| 63 | + 'desc' => __('Enter button label in case you would like to display the forms in a popup.', 'invoicing'), |
|
| 64 | 64 | 'type' => 'text', |
| 65 | 65 | 'desc_tip' => true, |
| 66 | 66 | 'default' => '', |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | - parent::__construct( $options ); |
|
| 74 | + parent::__construct($options); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -83,23 +83,23 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return string |
| 85 | 85 | */ |
| 86 | - public function output( $args = array(), $widget_args = array(), $content = '' ) { |
|
| 86 | + public function output($args = array(), $widget_args = array(), $content = '') { |
|
| 87 | 87 | |
| 88 | 88 | // Is the shortcode set up correctly? |
| 89 | - if ( empty( $args['form'] ) && empty( $args['item'] ) ) { |
|
| 89 | + if (empty($args['form']) && empty($args['item'])) { |
|
| 90 | 90 | return aui()->alert( |
| 91 | 91 | array( |
| 92 | 92 | 'type' => 'warning', |
| 93 | - 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
| 93 | + 'content' => __('No payment form or item selected', 'invoicing'), |
|
| 94 | 94 | ) |
| 95 | 95 | ); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Payment form or button? |
| 99 | - if ( ! empty( $args['form'] ) ) { |
|
| 100 | - return $this->handle_payment_form( $args ); |
|
| 99 | + if (!empty($args['form'])) { |
|
| 100 | + return $this->handle_payment_form($args); |
|
| 101 | 101 | } else { |
| 102 | - return $this->handle_buy_item( $args ); |
|
| 102 | + return $this->handle_buy_item($args); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | } |
@@ -109,15 +109,15 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @return string |
| 111 | 111 | */ |
| 112 | - protected function handle_payment_form( $args = array() ) { |
|
| 112 | + protected function handle_payment_form($args = array()) { |
|
| 113 | 113 | |
| 114 | - if ( empty( $args['button'] ) ) { |
|
| 114 | + if (empty($args['button'])) { |
|
| 115 | 115 | ob_start(); |
| 116 | - getpaid_display_payment_form( $args['form'] ); |
|
| 116 | + getpaid_display_payment_form($args['form']); |
|
| 117 | 117 | return ob_get_clean(); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - return $this->payment_form_button( $args['form'], $args['button'] ); |
|
| 120 | + return $this->payment_form_button($args['form'], $args['button']); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @return string |
| 127 | 127 | */ |
| 128 | - protected function payment_form_button( $form, $button ) { |
|
| 129 | - return getpaid_get_payment_button( $button, $form ); |
|
| 128 | + protected function payment_form_button($form, $button) { |
|
| 129 | + return getpaid_get_payment_button($button, $form); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | * |
| 135 | 135 | * @return string |
| 136 | 136 | */ |
| 137 | - protected function handle_buy_item( $args = array() ) { |
|
| 137 | + protected function handle_buy_item($args = array()) { |
|
| 138 | 138 | |
| 139 | - if ( empty( $args['button'] ) ) { |
|
| 140 | - return $this->buy_item_form( $args['item'] ); |
|
| 139 | + if (empty($args['button'])) { |
|
| 140 | + return $this->buy_item_form($args['item']); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - return $this->buy_item_button( $args['item'], $args['button'] ); |
|
| 143 | + return $this->buy_item_button($args['item'], $args['button']); |
|
| 144 | 144 | |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,10 +149,10 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @return string |
| 151 | 151 | */ |
| 152 | - protected function buy_item_form( $item ) { |
|
| 153 | - $items = getpaid_convert_items_to_array( $item ); |
|
| 152 | + protected function buy_item_form($item) { |
|
| 153 | + $items = getpaid_convert_items_to_array($item); |
|
| 154 | 154 | ob_start(); |
| 155 | - getpaid_display_item_payment_form( $items ); |
|
| 155 | + getpaid_display_item_payment_form($items); |
|
| 156 | 156 | return ob_get_clean(); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | * |
| 162 | 162 | * @return string |
| 163 | 163 | */ |
| 164 | - protected function buy_item_button( $item, $button ) { |
|
| 165 | - $button = getpaid_get_payment_button( $button, null, $item ); |
|
| 166 | - return apply_filters( 'getpaid_buy_item_button_widget', $button, $item ); |
|
| 164 | + protected function buy_item_button($item, $button) { |
|
| 165 | + $button = getpaid_get_payment_button($button, null, $item); |
|
| 166 | + return apply_filters('getpaid_buy_item_button_widget', $button, $item); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | <div class="row"> |
| 17 | 17 | |
| 18 | 18 | <div class="col-12 col-sm-6 text-sm-left pl-sm-0"> |
| 19 | - <?php do_action( 'getpaid_invoice_header_left', $invoice ); ?> |
|
| 19 | + <?php do_action('getpaid_invoice_header_left', $invoice); ?> |
|
| 20 | 20 | </div> |
| 21 | 21 | |
| 22 | 22 | <div class="col-12 col-sm-6 text-sm-right pr-sm-0"> |
| 23 | - <?php do_action( 'getpaid_invoice_header_right', $invoice ); ?> |
|
| 23 | + <?php do_action('getpaid_invoice_header_right', $invoice); ?> |
|
| 24 | 24 | </div> |
| 25 | 25 | |
| 26 | 26 | </div> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays the invoice header. |
| 4 | 4 | * |
@@ -7,9 +7,9 @@ discard block |
||
| 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="d-print-none border-bottom pt-3 pb-3 bg-white"> |
| 15 | 15 | <div class="container"> |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | |
| 34 | 34 | // Display the item totals. |
| 35 | 35 | foreach ( $invoice->get_items() as $item ) { |
| 36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 36 | + wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Display the fee totals. |
| 40 | 40 | foreach ( $invoice->get_fees() as $fee ) { |
| 41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 41 | + wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Display the cart totals. |
@@ -8,21 +8,21 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | -<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
| 15 | +<?php do_action('getpaid_invoice_before_line_items', $invoice); ?> |
|
| 16 | 16 | |
| 17 | - <h2 class="mt-5 mb-1 h4"><?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?></h2> |
|
| 17 | + <h2 class="mt-5 mb-1 h4"><?php echo sprintf(esc_html__('%s Items', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?></h2> |
|
| 18 | 18 | <div class="getpaid-invoice-items mb-4 border"> |
| 19 | 19 | |
| 20 | 20 | |
| 21 | - <div class="getpaid-invoice-items-header <?php echo esc_attr( $invoice->get_template() ); ?>"> |
|
| 21 | + <div class="getpaid-invoice-items-header <?php echo esc_attr($invoice->get_template()); ?>"> |
|
| 22 | 22 | <div class="form-row row"> |
| 23 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 24 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>"> |
|
| 25 | - <?php echo esc_html( $label ); ?> |
|
| 23 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 24 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr($key); ?>"> |
|
| 25 | + <?php echo esc_html($label); ?> |
|
| 26 | 26 | </div> |
| 27 | 27 | <?php endforeach; ?> |
| 28 | 28 | </div> |
@@ -32,20 +32,20 @@ discard block |
||
| 32 | 32 | <?php |
| 33 | 33 | |
| 34 | 34 | // Display the item totals. |
| 35 | - foreach ( $invoice->get_items() as $item ) { |
|
| 36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 35 | + foreach ($invoice->get_items() as $item) { |
|
| 36 | + wpinv_get_template('invoice/line-item.php', compact('invoice', 'item', 'columns')); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Display the fee totals. |
| 40 | - foreach ( $invoice->get_fees() as $fee ) { |
|
| 41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 40 | + foreach ($invoice->get_fees() as $fee) { |
|
| 41 | + wpinv_get_template('invoice/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Display the cart totals. |
| 45 | - wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
| 45 | + wpinv_get_template('invoice/line-totals.php', compact('invoice')); |
|
| 46 | 46 | |
| 47 | 47 | ?> |
| 48 | 48 | |
| 49 | 49 | </div> |
| 50 | 50 | |
| 51 | -<?php do_action( 'getpaid_invoice_after_line_items', $invoice ); ?> |
|
| 51 | +<?php do_action('getpaid_invoice_after_line_items', $invoice); ?> |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays a line items in an invoice. |
| 4 | 4 | * |
@@ -8,11 +8,11 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -?> |
|
| 14 | - |
|
| 15 | -<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
| 13 | + ?> |
|
| 14 | + |
|
| 15 | + <?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
| 16 | 16 | |
| 17 | 17 | <h2 class="mt-5 mb-1 h4"><?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?></h2> |
| 18 | 18 | <div class="getpaid-invoice-items mb-4 border"> |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | <div class="getpaid-invoice-items-header <?php echo esc_attr( $invoice->get_template() ); ?>"> |
| 22 | 22 | <div class="form-row row"> |
| 23 | 23 | <?php foreach ( $columns as $key => $label ) : ?> |
| 24 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>"> |
|
| 24 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>"> |
|
| 25 | 25 | <?php echo esc_html( $label ); ?> |
| 26 | - </div> |
|
| 26 | + </div> |
|
| 27 | 27 | <?php endforeach; ?> |
| 28 | 28 | </div> |
| 29 | 29 | </div> |
@@ -31,20 +31,20 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | <?php |
| 33 | 33 | |
| 34 | - // Display the item totals. |
|
| 35 | - foreach ( $invoice->get_items() as $item ) { |
|
| 36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 37 | - } |
|
| 34 | + // Display the item totals. |
|
| 35 | + foreach ( $invoice->get_items() as $item ) { |
|
| 36 | + wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - // Display the fee totals. |
|
| 40 | - foreach ( $invoice->get_fees() as $fee ) { |
|
| 41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 42 | - } |
|
| 39 | + // Display the fee totals. |
|
| 40 | + foreach ( $invoice->get_fees() as $fee ) { |
|
| 41 | + wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - // Display the cart totals. |
|
| 45 | - wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
| 44 | + // Display the cart totals. |
|
| 45 | + wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
| 46 | 46 | |
| 47 | - ?> |
|
| 47 | + ?> |
|
| 48 | 48 | |
| 49 | 49 | </div> |
| 50 | 50 | |
@@ -7,24 +7,24 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -$logo_width = wpinv_get_option( 'logo_width' ); |
|
| 13 | -$logo_height = wpinv_get_option( 'logo_height' ); |
|
| 12 | +$logo_width = wpinv_get_option('logo_width'); |
|
| 13 | +$logo_height = wpinv_get_option('logo_height'); |
|
| 14 | 14 | |
| 15 | 15 | ?> |
| 16 | -<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 16 | +<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
| 17 | 17 | |
| 18 | - <?php if ( $logo = wpinv_get_business_logo() ) : ?> |
|
| 18 | + <?php if ($logo = wpinv_get_business_logo()) : ?> |
|
| 19 | 19 | |
| 20 | - <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
|
| 21 | - <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 20 | + <?php if (!empty($logo_width) && !empty($logo_height)) : ?> |
|
| 21 | + <img class="logo" style="max-width:100%; width:<?php echo absint($logo_width); ?>px; height:<?php echo absint($logo_height); ?>px;" src="<?php echo esc_url($logo); ?>"> |
|
| 22 | 22 | <?php else : ?> |
| 23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 23 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url($logo); ?>"> |
|
| 24 | 24 | <?php endif; ?> |
| 25 | 25 | |
| 26 | 26 | <?php else : ?> |
| 27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 27 | + <h1 class="h3"><?php echo esc_html(wpinv_get_business_name()); ?></h1> |
|
| 28 | 28 | <?php endif; ?> |
| 29 | 29 | |
| 30 | 30 | </a> |
@@ -19,12 +19,18 @@ |
||
| 19 | 19 | |
| 20 | 20 | <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
| 21 | 21 | <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
| 22 | - <?php else : ?> |
|
| 23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 22 | + <?php else { |
|
| 23 | + : ?> |
|
| 24 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); |
|
| 25 | +} |
|
| 26 | +?>"> |
|
| 24 | 27 | <?php endif; ?> |
| 25 | 28 | |
| 26 | - <?php else : ?> |
|
| 27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 29 | + <?php else { |
|
| 30 | + : ?> |
|
| 31 | + <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); |
|
| 32 | +} |
|
| 33 | +?></h1> |
|
| 28 | 34 | <?php endif; ?> |
| 29 | 35 | |
| 30 | 36 | </a> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays left side of the invoice title. |
| 4 | 4 | * |
@@ -7,24 +7,24 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -$logo_width = wpinv_get_option( 'logo_width' ); |
|
| 13 | -$logo_height = wpinv_get_option( 'logo_height' ); |
|
| 12 | + $logo_width = wpinv_get_option( 'logo_width' ); |
|
| 13 | + $logo_height = wpinv_get_option( 'logo_height' ); |
|
| 14 | 14 | |
| 15 | -?> |
|
| 16 | -<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 15 | + ?> |
|
| 16 | + <a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 17 | 17 | |
| 18 | 18 | <?php if ( $logo = wpinv_get_business_logo() ) : ?> |
| 19 | - |
|
| 19 | + |
|
| 20 | 20 | <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
| 21 | - <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 21 | + <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 22 | 22 | <?php else : ?> |
| 23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 23 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 24 | 24 | <?php endif; ?> |
| 25 | - |
|
| 25 | + |
|
| 26 | 26 | <?php else : ?> |
| 27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 27 | + <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 28 | 28 | <?php endif; ?> |
| 29 | 29 | |
| 30 | 30 | </a> |
@@ -40,19 +40,19 @@ |
||
| 40 | 40 | <?php |
| 41 | 41 | |
| 42 | 42 | if ( ! $invoice->exists() || $invoice->is_draft() ) { |
| 43 | - $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
| 43 | + $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
| 44 | 44 | } else { |
| 45 | 45 | |
| 46 | - $user_id = get_current_user_id(); |
|
| 47 | - if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
| 48 | - $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
| 49 | - $error .= sprintf( |
|
| 50 | - ' <a href="%s">%s</a>', |
|
| 51 | - wp_login_url( $invoice->get_view_url() ), |
|
| 52 | - __( 'Login.', 'invoicing' ) |
|
| 53 | - ); |
|
| 54 | - } else { |
|
| 55 | - $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
| 46 | + $user_id = get_current_user_id(); |
|
| 47 | + if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
| 48 | + $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
| 49 | + $error .= sprintf( |
|
| 50 | + ' <a href="%s">%s</a>', |
|
| 51 | + wp_login_url( $invoice->get_view_url() ), |
|
| 52 | + __( 'Login.', 'invoicing' ) |
|
| 53 | + ); |
|
| 54 | + } else { |
|
| 55 | + $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -7,11 +7,11 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Fetch the invoice. |
| 13 | -if ( empty( $invoice ) ) { |
|
| 14 | - $invoice = new WPInv_Invoice( $GLOBALS['post'] ); |
|
| 13 | +if (empty($invoice)) { |
|
| 14 | + $invoice = new WPInv_Invoice($GLOBALS['post']); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | ?><!DOCTYPE html> |
@@ -21,16 +21,16 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | <head> |
| 23 | 23 | |
| 24 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
| 24 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
| 25 | 25 | <meta name="viewport" content="width=device-width, initial-scale=1.0" > |
| 26 | 26 | |
| 27 | 27 | <meta name="robots" content="noindex,nofollow"> |
| 28 | 28 | |
| 29 | 29 | <link rel="profile" href="https://gmpg.org/xfn/11"> |
| 30 | 30 | |
| 31 | - <title><?php esc_html_e( 'Invalid Access', 'invoicing' ); ?></title> |
|
| 31 | + <title><?php esc_html_e('Invalid Access', 'invoicing'); ?></title> |
|
| 32 | 32 | |
| 33 | - <?php do_action( 'wpinv_invoice_print_head', $invoice ); ?> |
|
| 33 | + <?php do_action('wpinv_invoice_print_head', $invoice); ?> |
|
| 34 | 34 | |
| 35 | 35 | </head> |
| 36 | 36 | |
@@ -39,20 +39,20 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <?php |
| 41 | 41 | |
| 42 | - if ( ! $invoice->exists() || $invoice->is_draft() ) { |
|
| 43 | - $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
| 42 | + if (!$invoice->exists() || $invoice->is_draft()) { |
|
| 43 | + $error = __('This invoice was deleted or is not visible.', 'invoicing'); |
|
| 44 | 44 | } else { |
| 45 | 45 | |
| 46 | 46 | $user_id = get_current_user_id(); |
| 47 | - if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
| 48 | - $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
| 47 | + if (wpinv_require_login_to_checkout() && empty($user_id)) { |
|
| 48 | + $error = __('You must be logged in to view this invoice.', 'invoicing'); |
|
| 49 | 49 | $error .= sprintf( |
| 50 | 50 | ' <a href="%s">%s</a>', |
| 51 | - wp_login_url( $invoice->get_view_url() ), |
|
| 52 | - __( 'Login.', 'invoicing' ) |
|
| 51 | + wp_login_url($invoice->get_view_url()), |
|
| 52 | + __('Login.', 'invoicing') |
|
| 53 | 53 | ); |
| 54 | 54 | } else { |
| 55 | - $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
| 55 | + $error = __('This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing'); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | <div class="container"> |
| 62 | 62 | <div class="alert alert-danger m-5" role="alert"> |
| 63 | - <h4 class="alert-heading"><?php esc_html_e( 'Access Denied', 'invoicing' ); ?></h4> |
|
| 64 | - <p><?php echo wp_kses_post( $error ); ?></p> |
|
| 63 | + <h4 class="alert-heading"><?php esc_html_e('Access Denied', 'invoicing'); ?></h4> |
|
| 64 | + <p><?php echo wp_kses_post($error); ?></p> |
|
| 65 | 65 | </div> |
| 66 | 66 | </div> |
| 67 | 67 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that prints the invoice page. |
| 4 | 4 | * |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Fetch the invoice. |
|
| 13 | -if ( empty( $invoice ) ) { |
|
| 14 | - $invoice = new WPInv_Invoice( $GLOBALS['post'] ); |
|
| 12 | + // Fetch the invoice. |
|
| 13 | + if ( empty( $invoice ) ) { |
|
| 14 | + $invoice = new WPInv_Invoice( $GLOBALS['post'] ); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -?><!DOCTYPE html> |
|
| 17 | + ?><!DOCTYPE html> |
|
| 18 | 18 | |
| 19 | 19 | <html <?php language_attributes(); ?> class="bsui"> |
| 20 | 20 | |
@@ -39,24 +39,24 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <?php |
| 41 | 41 | |
| 42 | - if ( ! $invoice->exists() || $invoice->is_draft() ) { |
|
| 43 | - $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
| 44 | - } else { |
|
| 45 | - |
|
| 46 | - $user_id = get_current_user_id(); |
|
| 47 | - if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
| 48 | - $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
| 49 | - $error .= sprintf( |
|
| 50 | - ' <a href="%s">%s</a>', |
|
| 51 | - wp_login_url( $invoice->get_view_url() ), |
|
| 52 | - __( 'Login.', 'invoicing' ) |
|
| 53 | - ); |
|
| 54 | - } else { |
|
| 55 | - $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
| 56 | - } |
|
| 42 | + if ( ! $invoice->exists() || $invoice->is_draft() ) { |
|
| 43 | + $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
| 44 | + } else { |
|
| 45 | + |
|
| 46 | + $user_id = get_current_user_id(); |
|
| 47 | + if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
| 48 | + $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
| 49 | + $error .= sprintf( |
|
| 50 | + ' <a href="%s">%s</a>', |
|
| 51 | + wp_login_url( $invoice->get_view_url() ), |
|
| 52 | + __( 'Login.', 'invoicing' ) |
|
| 53 | + ); |
|
| 54 | + } else { |
|
| 55 | + $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - ?> |
|
| 59 | + ?> |
|
| 60 | 60 | |
| 61 | 61 | <div class="container"> |
| 62 | 62 | <div class="alert alert-danger m-5" role="alert"> |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <hr class="featurette-divider" /> |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | <component :is='form_element.level' v-html='form_element.text'></component> |
@@ -7,44 +7,44 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -if ( empty( $form->get_items() ) ) { |
|
| 12 | +if (empty($form->get_items())) { |
|
| 13 | 13 | return; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) { |
|
| 16 | +if (!empty($GLOBALS['getpaid_force_checkbox'])) { |
|
| 17 | 17 | $items_type = 'checkbox'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -if ( empty( $items_type ) ) { |
|
| 20 | +if (empty($items_type)) { |
|
| 21 | 21 | $items_type = 'total'; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -do_action( 'getpaid_before_payment_form_items', $form ); |
|
| 24 | +do_action('getpaid_before_payment_form_items', $form); |
|
| 25 | 25 | |
| 26 | -switch ( $items_type ) { |
|
| 26 | +switch ($items_type) { |
|
| 27 | 27 | case 'radio': |
| 28 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
| 28 | + wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type')); |
|
| 29 | 29 | break; |
| 30 | 30 | case 'checkbox': |
| 31 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
| 31 | + wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type')); |
|
| 32 | 32 | break; |
| 33 | 33 | case 'select': |
| 34 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
| 34 | + wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type')); |
|
| 35 | 35 | break; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -do_action( 'getpaid_before_payment_form_cart', $form ); |
|
| 38 | +do_action('getpaid_before_payment_form_cart', $form); |
|
| 39 | 39 | |
| 40 | 40 | // Display the cart totals. |
| 41 | -if ( ! empty( $hide_cart ) ) { |
|
| 41 | +if (!empty($hide_cart)) { |
|
| 42 | 42 | echo '<div class="d-none">'; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Display the cart totals. |
| 46 | -wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
| 46 | +wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type')); |
|
| 47 | 47 | |
| 48 | -if ( ! empty( $hide_cart ) ) { |
|
| 48 | +if (!empty($hide_cart)) { |
|
| 49 | 49 | echo '</div>'; |
| 50 | 50 | } |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays item totals in payment form |
| 4 | 4 | * |
@@ -7,21 +7,21 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -if ( empty( $form->get_items() ) ) { |
|
| 13 | - return; |
|
| 12 | + if ( empty( $form->get_items() ) ) { |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) { |
|
| 17 | - $items_type = 'checkbox'; |
|
| 16 | + if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) { |
|
| 17 | + $items_type = 'checkbox'; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -if ( empty( $items_type ) ) { |
|
| 21 | - $items_type = 'total'; |
|
| 20 | + if ( empty( $items_type ) ) { |
|
| 21 | + $items_type = 'total'; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -do_action( 'getpaid_before_payment_form_items', $form ); |
|
| 24 | + do_action( 'getpaid_before_payment_form_items', $form ); |
|
| 25 | 25 | |
| 26 | 26 | switch ( $items_type ) { |
| 27 | 27 | case 'radio': |
@@ -35,16 +35,16 @@ discard block |
||
| 35 | 35 | break; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -do_action( 'getpaid_before_payment_form_cart', $form ); |
|
| 38 | + do_action( 'getpaid_before_payment_form_cart', $form ); |
|
| 39 | 39 | |
| 40 | -// Display the cart totals. |
|
| 41 | -if ( ! empty( $hide_cart ) ) { |
|
| 42 | - echo '<div class="d-none">'; |
|
| 40 | + // Display the cart totals. |
|
| 41 | + if ( ! empty( $hide_cart ) ) { |
|
| 42 | + echo '<div class="d-none">'; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -// Display the cart totals. |
|
| 46 | -wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
| 45 | + // Display the cart totals. |
|
| 46 | + wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
| 47 | 47 | |
| 48 | -if ( ! empty( $hide_cart ) ) { |
|
| 49 | - echo '</div>'; |
|
| 48 | + if ( ! empty( $hide_cart ) ) { |
|
| 49 | + echo '</div>'; |
|
| 50 | 50 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | 46 | foreach ( $form->get_items() as $item ) { |
| 47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
| 47 | + wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the cart totals. |
@@ -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); |
|
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays the cart in a payment form |
| 4 | 4 | * |
@@ -7,33 +7,33 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -// Cart table columns. |
|
| 13 | -$columns = array( |
|
| 14 | - 'name' => __( 'Item', 'invoicing' ), |
|
| 15 | - 'price' => __( 'Price', 'invoicing' ), |
|
| 16 | - 'quantity' => __( 'Qty', 'invoicing' ), |
|
| 17 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
| 18 | -); |
|
| 12 | + // Cart table columns. |
|
| 13 | + $columns = array( |
|
| 14 | + 'name' => __( 'Item', 'invoicing' ), |
|
| 15 | + 'price' => __( 'Price', 'invoicing' ), |
|
| 16 | + 'quantity' => __( 'Qty', 'invoicing' ), |
|
| 17 | + 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
| 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 | 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 ); ?>"> |
|
| 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 | 37 | <span><?php echo esc_html( $label ); ?></span> |
| 38 | 38 | </div> |
| 39 | 39 | <?php endforeach; ?> |
@@ -42,17 +42,17 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | <?php |
| 44 | 44 | |
| 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' ) ); |
|
| 48 | - } |
|
| 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' ) ); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - // Display the cart totals. |
|
| 51 | - wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
| 50 | + // Display the cart totals. |
|
| 51 | + wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
| 52 | 52 | |
| 53 | - ?> |
|
| 54 | - </div> |
|
| 53 | + ?> |
|
| 54 | + </div> |
|
| 55 | 55 | |
| 56 | -<?php |
|
| 56 | + <?php |
|
| 57 | 57 | |
| 58 | -do_action( 'getpaid_after_payment_form_cart', $form ); |
|
| 58 | + do_action( 'getpaid_after_payment_form_cart', $form ); |
|