WooCommerce PDF Invoices & Packing Slips - Version 3.2.3

Version Description

(2022-10-28) = * Fix: check if the order is unsaved or doesn't exist before rendering the PDF document * Fix: bug on getting the order ID from third party objects when attaching PDF to email * Fix: reverts documents functions/templates escaping that caused issues on version 3.2.2 * Fix: billing/shipping phone getter functions for refund orders * Tested up to WordPress 6.1

Download this release

Release Info

Developer wpovernight
Plugin Icon 128x128 WooCommerce PDF Invoices & Packing Slips
Version 3.2.3
Comparing to
See all releases

Code changes from version 3.2.2 to 3.2.3

includes/class-wcpdf-admin.php CHANGED
@@ -255,12 +255,12 @@ class Admin {
255
 
256
  switch ( $column ) {
257
  case 'invoice_number_column':
258
- $invoice_number = ! empty( $invoice ) && ! empty( $invoice->get_number() ) ? esc_attr( $invoice->get_number() ) : '';
259
  echo $invoice_number;
260
  do_action( 'wcpdf_invoice_number_column_end', $order );
261
  break;
262
  case 'invoice_date_column':
263
- $invoice_date = ! empty( $invoice ) && ! empty( $invoice->get_date() ) ? esc_attr( $invoice->get_date()->date_i18n( wcpdf_date_format( $invoice, 'invoice_date_column' ) ) ) : '';
264
  echo $invoice_date;
265
  do_action( 'wcpdf_invoice_date_column_end', $order );
266
  break;
255
 
256
  switch ( $column ) {
257
  case 'invoice_number_column':
258
+ $invoice_number = ! empty( $invoice ) && ! empty( $invoice->get_number() ) ? $invoice->get_number() : '';
259
  echo $invoice_number;
260
  do_action( 'wcpdf_invoice_number_column_end', $order );
261
  break;
262
  case 'invoice_date_column':
263
+ $invoice_date = ! empty( $invoice ) && ! empty( $invoice->get_date() ) ? $invoice->get_date()->date_i18n( wcpdf_date_format( $invoice, 'invoice_date_column' ) ) : '';
264
  echo $invoice_date;
265
  do_action( 'wcpdf_invoice_date_column_end', $order );
266
  break;
includes/class-wcpdf-main.php CHANGED
@@ -77,7 +77,7 @@ class Main {
77
  return $attachments;
78
  }
79
 
80
- $order_id = $order->get_id();
81
 
82
  if ( ! ( $order instanceof \WC_Order || is_subclass_of( $order, '\WC_Abstract_Order') ) && $order_id == false ) {
83
  return $attachments;
@@ -301,6 +301,19 @@ class Main {
301
  $document_type = sanitize_text_field( $_REQUEST['document_type'] );
302
 
303
  $order_ids = (array) array_map( 'absint', explode( 'x', $_REQUEST['order_ids'] ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
304
 
305
  // Process oldest first: reverse $order_ids array if required
306
  $sort_order = apply_filters( 'wpo_wcpdf_bulk_document_sort_order', 'ASC' );
@@ -317,7 +330,6 @@ class Main {
317
  if ( count( $order_ids ) > 1 ) {
318
  $allowed = false;
319
  } else {
320
- $order = wc_get_order( $order_ids[0] );
321
  if ( ! $order || ! hash_equals( $order->get_order_key(), $_REQUEST['access_key'] ) ) {
322
  $allowed = false;
323
  }
77
  return $attachments;
78
  }
79
 
80
+ $order_id = is_callable( array( $order, 'get_id' ) ) ? $order->get_id() : false;
81
 
82
  if ( ! ( $order instanceof \WC_Order || is_subclass_of( $order, '\WC_Abstract_Order') ) && $order_id == false ) {
83
  return $attachments;
301
  $document_type = sanitize_text_field( $_REQUEST['document_type'] );
302
 
303
  $order_ids = (array) array_map( 'absint', explode( 'x', $_REQUEST['order_ids'] ) );
304
+
305
+ // solo order
306
+ $order = false;
307
+ if ( count( $order_ids ) === 1 ) {
308
+ $order_id = reset( $order_ids );
309
+ $order = wc_get_order( $order_id );
310
+ if ( $order && $order->get_status() == 'auto-draft' ) {
311
+ wp_die( esc_attr__( 'You have to save the order before generating a PDF document for it.', 'woocommerce-pdf-invoices-packing-slips' ) );
312
+ } elseif ( ! $order ) {
313
+ /* translators: %s: Order ID */
314
+ wp_die( sprintf( esc_attr__( 'Could not find the order #%s.', 'woocommerce-pdf-invoices-packing-slips' ), $order_id ) );
315
+ }
316
+ }
317
 
318
  // Process oldest first: reverse $order_ids array if required
319
  $sort_order = apply_filters( 'wpo_wcpdf_bulk_document_sort_order', 'ASC' );
330
  if ( count( $order_ids ) > 1 ) {
331
  $allowed = false;
332
  } else {
 
333
  if ( ! $order || ! hash_equals( $order->get_order_key(), $_REQUEST['access_key'] ) ) {
334
  $allowed = false;
335
  }
includes/documents/abstract-wcpdf-order-document-methods.php CHANGED
@@ -103,7 +103,7 @@ abstract class Order_Document_Methods extends Order_Document {
103
  return $address;
104
  }
105
  public function billing_address() {
106
- echo wp_kses_post( $this->get_billing_address() );
107
  }
108
 
109
  /**
@@ -134,23 +134,18 @@ abstract class Order_Document_Methods extends Order_Document {
134
  return apply_filters( 'wpo_wcpdf_billing_email', $billing_email, $this );
135
  }
136
  public function billing_email() {
137
- echo wp_kses_post( $this->get_billing_email() );
138
  }
139
 
140
  /**
141
  * Return/Show phone by type
142
  */
143
  public function get_phone( $phone_type = 'billing' ) {
144
- $phone_type = "get_{$phone_type}_phone";
145
- $phone = call_user_func( array( $this->order, $phone_type ) );
146
-
147
- // on refund orders
148
- if ( ! $phone && $this->is_refund( $this->order ) ) {
149
- // try parent
150
- $parent_order = $this->get_refund_parent( $this->order );
151
- $phone = call_user_func( array( $parent_order, $phone_type ) );
152
  }
153
-
154
  return $phone;
155
  }
156
 
@@ -171,11 +166,11 @@ abstract class Order_Document_Methods extends Order_Document {
171
  }
172
 
173
  public function billing_phone() {
174
- echo wp_kses_post( $this->get_billing_phone() );
175
  }
176
 
177
  public function shipping_phone( $fallback_to_billing = false ) {
178
- echo wp_kses_post( $this->get_shipping_phone( $fallback_to_billing ) );
179
  }
180
 
181
  /**
@@ -208,7 +203,7 @@ abstract class Order_Document_Methods extends Order_Document {
208
  return $address;
209
  }
210
  public function shipping_address() {
211
- echo wp_kses_post( $this->get_shipping_address() );
212
  }
213
 
214
  /**
@@ -263,7 +258,7 @@ abstract class Order_Document_Methods extends Order_Document {
263
  }
264
 
265
  if (!empty($custom_field) || $display_empty) {
266
- echo wp_kses_post( $field_label . nl2br ($custom_field) );
267
  }
268
  }
269
 
@@ -360,7 +355,7 @@ abstract class Order_Document_Methods extends Order_Document {
360
  return isset($attribute) ? $attribute : false;
361
  }
362
  public function product_attribute( $attribute_name, $product ) {
363
- echo wp_kses_post( $this->get_product_attribute( $attribute_name, $product ) );
364
  }
365
 
366
  /**
@@ -447,7 +442,7 @@ abstract class Order_Document_Methods extends Order_Document {
447
  return apply_filters( 'wpo_wcpdf_date', date_i18n( wcpdf_date_format( $this, 'current_date' ) ) );
448
  }
449
  public function current_date() {
450
- echo wp_kses_post( $this->get_current_date() );
451
  }
452
 
453
  /**
@@ -468,7 +463,7 @@ abstract class Order_Document_Methods extends Order_Document {
468
  return apply_filters( 'wpo_wcpdf_payment_method', $payment_method, $this );
469
  }
470
  public function payment_method() {
471
- echo wp_kses_post( $this->get_payment_method() );
472
  }
473
 
474
  /**
@@ -480,7 +475,7 @@ abstract class Order_Document_Methods extends Order_Document {
480
  return apply_filters( 'wpo_wcpdf_shipping_method', $shipping_method, $this );
481
  }
482
  public function shipping_method() {
483
- echo wp_kses_post( $this->get_shipping_method() );
484
  }
485
 
486
  /**
@@ -501,7 +496,7 @@ abstract class Order_Document_Methods extends Order_Document {
501
  return apply_filters( 'wpo_wcpdf_order_number', $order_number, $this );
502
  }
503
  public function order_number() {
504
- echo esc_attr( $this->get_order_number() );
505
  }
506
 
507
  /**
@@ -520,7 +515,7 @@ abstract class Order_Document_Methods extends Order_Document {
520
  return apply_filters( 'wpo_wcpdf_order_date', $date, $mysql_date, $this );
521
  }
522
  public function order_date() {
523
- echo wp_kses_post( $this->get_order_date() );
524
  }
525
 
526
  /**
@@ -942,7 +937,7 @@ abstract class Order_Document_Methods extends Order_Document {
942
  }
943
  public function order_subtotal( $tax = 'excl', $discount = 'incl' ) {
944
  $subtotal = $this->get_order_subtotal( $tax, $discount );
945
- echo wp_kses_post( $subtotal['value'] );
946
  }
947
 
948
  /**
@@ -967,7 +962,7 @@ abstract class Order_Document_Methods extends Order_Document {
967
  }
968
  public function order_shipping( $tax = 'excl' ) {
969
  $shipping = $this->get_order_shipping( $tax );
970
- echo wp_kses_post( $shipping['value'] );
971
  }
972
 
973
  /**
@@ -1009,7 +1004,7 @@ abstract class Order_Document_Methods extends Order_Document {
1009
  }
1010
  public function order_discount( $type = 'total', $tax = 'incl' ) {
1011
  $discount = $this->get_order_discount( $type, $tax );
1012
- echo wp_kses_post( $discount['value'] );
1013
  }
1014
 
1015
  /**
@@ -1080,7 +1075,7 @@ abstract class Order_Document_Methods extends Order_Document {
1080
  }
1081
  public function order_grand_total( $tax = 'incl' ) {
1082
  $grand_total = $this->get_order_grand_total( $tax );
1083
- echo wp_kses_post( $grand_total['value'] );
1084
  }
1085
 
1086
 
@@ -1102,7 +1097,7 @@ abstract class Order_Document_Methods extends Order_Document {
1102
  return apply_filters( 'wpo_wcpdf_shipping_notes', $shipping_notes, $this );
1103
  }
1104
  public function shipping_notes() {
1105
- echo wp_kses_post( $this->get_shipping_notes() );
1106
  }
1107
 
1108
  /**
@@ -1156,7 +1151,7 @@ abstract class Order_Document_Methods extends Order_Document {
1156
  }
1157
 
1158
  public function invoice_number() {
1159
- echo esc_attr( $this->get_invoice_number() );
1160
  }
1161
 
1162
  public function get_invoice_date() {
@@ -1168,7 +1163,7 @@ abstract class Order_Document_Methods extends Order_Document {
1168
  }
1169
 
1170
  public function invoice_date() {
1171
- echo wp_kses_post( $this->get_invoice_date() );
1172
  }
1173
 
1174
  public function get_document_notes() {
@@ -1182,9 +1177,9 @@ abstract class Order_Document_Methods extends Order_Document {
1182
  public function document_notes() {
1183
  $document_notes = $this->get_document_notes();
1184
  if( $document_notes == strip_tags( $document_notes ) ) {
1185
- echo wp_kses_post( nl2br( $document_notes ) );
1186
  } else {
1187
- echo wp_kses_post( $document_notes );
1188
  }
1189
  }
1190
 
103
  return $address;
104
  }
105
  public function billing_address() {
106
+ echo $this->get_billing_address();
107
  }
108
 
109
  /**
134
  return apply_filters( 'wpo_wcpdf_billing_email', $billing_email, $this );
135
  }
136
  public function billing_email() {
137
+ echo $this->get_billing_email();
138
  }
139
 
140
  /**
141
  * Return/Show phone by type
142
  */
143
  public function get_phone( $phone_type = 'billing' ) {
144
+ $phone = '';
145
+ if ( ! empty( $order = $this->is_refund( $this->order ) ? $this->get_refund_parent( $this->order ) : $this->order ) ) {
146
+ $getter = "get_{$phone_type}_phone";
147
+ $phone = is_callable( array( $order, $getter ) ) ? call_user_func( array( $order, $getter ) ) : $phone;
 
 
 
 
148
  }
 
149
  return $phone;
150
  }
151
 
166
  }
167
 
168
  public function billing_phone() {
169
+ echo $this->get_billing_phone();
170
  }
171
 
172
  public function shipping_phone( $fallback_to_billing = false ) {
173
+ echo $this->get_shipping_phone( $fallback_to_billing );
174
  }
175
 
176
  /**
203
  return $address;
204
  }
205
  public function shipping_address() {
206
+ echo $this->get_shipping_address();
207
  }
208
 
209
  /**
258
  }
259
 
260
  if (!empty($custom_field) || $display_empty) {
261
+ echo $field_label . nl2br ($custom_field);
262
  }
263
  }
264
 
355
  return isset($attribute) ? $attribute : false;
356
  }
357
  public function product_attribute( $attribute_name, $product ) {
358
+ echo $this->get_product_attribute( $attribute_name, $product );
359
  }
360
 
361
  /**
442
  return apply_filters( 'wpo_wcpdf_date', date_i18n( wcpdf_date_format( $this, 'current_date' ) ) );
443
  }
444
  public function current_date() {
445
+ echo $this->get_current_date();
446
  }
447
 
448
  /**
463
  return apply_filters( 'wpo_wcpdf_payment_method', $payment_method, $this );
464
  }
465
  public function payment_method() {
466
+ echo $this->get_payment_method();
467
  }
468
 
469
  /**
475
  return apply_filters( 'wpo_wcpdf_shipping_method', $shipping_method, $this );
476
  }
477
  public function shipping_method() {
478
+ echo $this->get_shipping_method();
479
  }
480
 
481
  /**
496
  return apply_filters( 'wpo_wcpdf_order_number', $order_number, $this );
497
  }
498
  public function order_number() {
499
+ echo $this->get_order_number();
500
  }
501
 
502
  /**
515
  return apply_filters( 'wpo_wcpdf_order_date', $date, $mysql_date, $this );
516
  }
517
  public function order_date() {
518
+ echo $this->get_order_date();
519
  }
520
 
521
  /**
937
  }
938
  public function order_subtotal( $tax = 'excl', $discount = 'incl' ) {
939
  $subtotal = $this->get_order_subtotal( $tax, $discount );
940
+ echo $subtotal['value'];
941
  }
942
 
943
  /**
962
  }
963
  public function order_shipping( $tax = 'excl' ) {
964
  $shipping = $this->get_order_shipping( $tax );
965
+ echo $shipping['value'];
966
  }
967
 
968
  /**
1004
  }
1005
  public function order_discount( $type = 'total', $tax = 'incl' ) {
1006
  $discount = $this->get_order_discount( $type, $tax );
1007
+ echo $discount['value'];
1008
  }
1009
 
1010
  /**
1075
  }
1076
  public function order_grand_total( $tax = 'incl' ) {
1077
  $grand_total = $this->get_order_grand_total( $tax );
1078
+ echo $grand_total['value'];
1079
  }
1080
 
1081
 
1097
  return apply_filters( 'wpo_wcpdf_shipping_notes', $shipping_notes, $this );
1098
  }
1099
  public function shipping_notes() {
1100
+ echo $this->get_shipping_notes();
1101
  }
1102
 
1103
  /**
1151
  }
1152
 
1153
  public function invoice_number() {
1154
+ echo $this->get_invoice_number();
1155
  }
1156
 
1157
  public function get_invoice_date() {
1163
  }
1164
 
1165
  public function invoice_date() {
1166
+ echo $this->get_invoice_date();
1167
  }
1168
 
1169
  public function get_document_notes() {
1177
  public function document_notes() {
1178
  $document_notes = $this->get_document_notes();
1179
  if( $document_notes == strip_tags( $document_notes ) ) {
1180
+ echo nl2br( $document_notes );
1181
  } else {
1182
+ echo $document_notes;
1183
  }
1184
  }
1185
 
includes/documents/abstract-wcpdf-order-document.php CHANGED
@@ -451,7 +451,7 @@ abstract class Order_Document {
451
  }
452
 
453
  public function title() {
454
- echo esc_html( $this->get_title() );
455
  }
456
 
457
  public function get_number_title() {
@@ -707,7 +707,7 @@ abstract class Order_Document {
707
  return $this->get_settings_text( 'shop_name', $default, false );
708
  }
709
  public function shop_name() {
710
- echo wp_kses_post( $this->get_shop_name() );
711
  }
712
 
713
  /**
@@ -717,7 +717,7 @@ abstract class Order_Document {
717
  return $this->get_settings_text( 'shop_address' );
718
  }
719
  public function shop_address() {
720
- echo wp_kses_post( $this->get_shop_address() );
721
  }
722
 
723
  /**
@@ -726,12 +726,12 @@ abstract class Order_Document {
726
  public function get_footer() {
727
  ob_start();
728
  do_action( 'wpo_wcpdf_before_footer', $this->get_type(), $this->order );
729
- echo wp_kses_post( $this->get_settings_text( 'footer' ) );
730
  do_action( 'wpo_wcpdf_after_footer', $this->get_type(), $this->order );
731
  return ob_get_clean();
732
  }
733
  public function footer() {
734
- echo wp_kses_post( $this->get_footer() );
735
  }
736
 
737
  /**
@@ -742,7 +742,7 @@ abstract class Order_Document {
742
 
743
  }
744
  public function extra_1() {
745
- echo wp_kses_post( $this->get_extra_1() );
746
  }
747
 
748
  /**
@@ -752,7 +752,7 @@ abstract class Order_Document {
752
  return $this->get_settings_text( 'extra_2' );
753
  }
754
  public function extra_2() {
755
- echo wp_kses_post( $this->get_extra_2() );
756
  }
757
 
758
  /**
@@ -762,7 +762,7 @@ abstract class Order_Document {
762
  return $this->get_settings_text( 'extra_3' );
763
  }
764
  public function extra_3() {
765
- echo wp_kses_post( $this->get_extra_3() );
766
  }
767
 
768
  /*
451
  }
452
 
453
  public function title() {
454
+ echo $this->get_title();
455
  }
456
 
457
  public function get_number_title() {
707
  return $this->get_settings_text( 'shop_name', $default, false );
708
  }
709
  public function shop_name() {
710
+ echo $this->get_shop_name();
711
  }
712
 
713
  /**
717
  return $this->get_settings_text( 'shop_address' );
718
  }
719
  public function shop_address() {
720
+ echo $this->get_shop_address();
721
  }
722
 
723
  /**
726
  public function get_footer() {
727
  ob_start();
728
  do_action( 'wpo_wcpdf_before_footer', $this->get_type(), $this->order );
729
+ echo $this->get_settings_text( 'footer' );
730
  do_action( 'wpo_wcpdf_after_footer', $this->get_type(), $this->order );
731
  return ob_get_clean();
732
  }
733
  public function footer() {
734
+ echo $this->get_footer();
735
  }
736
 
737
  /**
742
 
743
  }
744
  public function extra_1() {
745
+ echo $this->get_extra_1();
746
  }
747
 
748
  /**
752
  return $this->get_settings_text( 'extra_2' );
753
  }
754
  public function extra_2() {
755
+ echo $this->get_extra_2();
756
  }
757
 
758
  /**
762
  return $this->get_settings_text( 'extra_3' );
763
  }
764
  public function extra_3() {
765
+ echo $this->get_extra_3();
766
  }
767
 
768
  /*
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice,
5
  Requires at least: 3.5
6
  Tested up to: 6.1
7
  Requires PHP: 7.1
8
- Stable tag: 3.2.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -22,7 +22,7 @@ This WooCommerce extension automatically adds a PDF invoice to the order confirm
22
  * **Fully customizable** HTML/CSS invoice templates
23
  * Download invoices from the My Account page
24
  * Sequential invoice numbers - with custom formatting
25
- * **Available in: Czech, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese (see FAQ for adding custom fonts!), Norwegian, Polish, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish & Ukrainian**
26
 
27
  In addition to this, we offer several premium extensions:
28
 
@@ -102,6 +102,13 @@ There's a setting on the Status tab of the settings page that allows you to togg
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
 
105
  = 3.2.2 (2022-10-25) =
106
  * New: filter to allow customers to access your PDF with a unique key
107
  * Fix: check if the shop logo exists
@@ -760,4 +767,4 @@ There's a setting on the Status tab of the settings page that allows you to togg
760
  == Upgrade Notice ==
761
 
762
  = 2.1.10 =
763
- 2.X is a BIG update! Make a full site backup before upgrading if you were using version 1.X!
5
  Requires at least: 3.5
6
  Tested up to: 6.1
7
  Requires PHP: 7.1
8
+ Stable tag: 3.2.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
22
  * **Fully customizable** HTML/CSS invoice templates
23
  * Download invoices from the My Account page
24
  * Sequential invoice numbers - with custom formatting
25
+ * **Available in: Czech, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese (see FAQ for adding custom fonts!), Norwegian, Portuguese, Polish, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish & Ukrainian**
26
 
27
  In addition to this, we offer several premium extensions:
28
 
102
 
103
  == Changelog ==
104
 
105
+ = 3.2.3 (2022-10-28) =
106
+ * Fix: check if the order is unsaved or doesn't exist before rendering the PDF document
107
+ * Fix: bug on getting the order ID from third party objects when attaching PDF to email
108
+ * Fix: reverts documents functions/templates escaping that caused issues on version 3.2.2
109
+ * Fix: billing/shipping phone getter functions for refund orders
110
+ * Tested up to WordPress 6.1
111
+
112
  = 3.2.2 (2022-10-25) =
113
  * New: filter to allow customers to access your PDF with a unique key
114
  * Fix: check if the shop logo exists
767
  == Upgrade Notice ==
768
 
769
  = 2.1.10 =
770
+ 2.X is a BIG update! Make a full site backup before upgrading if you were using version 1.X!
templates/Simple/invoice.php CHANGED
@@ -64,13 +64,13 @@
64
  <?php do_action( 'wpo_wcpdf_before_order_data', $this->get_type(), $this->order ); ?>
65
  <?php if ( isset( $this->settings['display_number'] ) ) : ?>
66
  <tr class="invoice-number">
67
- <th><?php echo esc_html( $this->get_number_title() ); ?></th>
68
  <td><?php $this->invoice_number(); ?></td>
69
  </tr>
70
  <?php endif; ?>
71
  <?php if ( isset( $this->settings['display_date'] ) ) : ?>
72
  <tr class="invoice-date">
73
- <th><?php echo esc_html( $this->get_date_title() ); ?></th>
74
  <td><?php $this->invoice_date(); ?></td>
75
  </tr>
76
  <?php endif; ?>
@@ -85,7 +85,7 @@
85
  <?php if ( $payment_method = $this->get_payment_method() ) : ?>
86
  <tr class="payment-method">
87
  <th><?php _e( 'Payment Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
88
- <td><?php echo esc_html( $payment_method ); ?></td>
89
  </tr>
90
  <?php endif; ?>
91
  <?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
@@ -109,9 +109,9 @@
109
  <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, esc_attr( $this->get_type() ), $this->order, $item_id ); ?>">
110
  <td class="product">
111
  <?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
112
- <span class="item-name"><?php echo esc_html( $item['name'] ); ?></span>
113
  <?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
114
- <span class="item-meta"><?php echo wp_kses_post( $item['meta'] ); ?></span>
115
  <dl class="meta">
116
  <?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
117
  <?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo esc_attr( $item['sku'] ); ?></dd><?php endif; ?>
@@ -119,8 +119,8 @@
119
  </dl>
120
  <?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
121
  </td>
122
- <td class="quantity"><?php echo esc_attr( $item['quantity'] ); ?></td>
123
- <td class="price"><?php echo wp_kses_post( $item['order_price'] ); ?></td>
124
  </tr>
125
  <?php endforeach; ?>
126
  </tbody>
@@ -149,8 +149,8 @@
149
  <tfoot>
150
  <?php foreach ( $this->get_woocommerce_totals() as $key => $total ) : ?>
151
  <tr class="<?php echo esc_attr( $key ); ?>">
152
- <th class="description"><?php echo esc_html( $total['label'] ); ?></th>
153
- <td class="price"><span class="totals-price"><?php echo wp_kses_post( $total['value'] ); ?></span></td>
154
  </tr>
155
  <?php endforeach; ?>
156
  </tfoot>
64
  <?php do_action( 'wpo_wcpdf_before_order_data', $this->get_type(), $this->order ); ?>
65
  <?php if ( isset( $this->settings['display_number'] ) ) : ?>
66
  <tr class="invoice-number">
67
+ <th><?php echo $this->get_number_title(); ?></th>
68
  <td><?php $this->invoice_number(); ?></td>
69
  </tr>
70
  <?php endif; ?>
71
  <?php if ( isset( $this->settings['display_date'] ) ) : ?>
72
  <tr class="invoice-date">
73
+ <th><?php echo $this->get_date_title(); ?></th>
74
  <td><?php $this->invoice_date(); ?></td>
75
  </tr>
76
  <?php endif; ?>
85
  <?php if ( $payment_method = $this->get_payment_method() ) : ?>
86
  <tr class="payment-method">
87
  <th><?php _e( 'Payment Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
88
+ <td><?php echo $payment_method; ?></td>
89
  </tr>
90
  <?php endif; ?>
91
  <?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
109
  <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, esc_attr( $this->get_type() ), $this->order, $item_id ); ?>">
110
  <td class="product">
111
  <?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
112
+ <span class="item-name"><?php echo $item['name']; ?></span>
113
  <?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
114
+ <span class="item-meta"><?php echo $item['meta']; ?></span>
115
  <dl class="meta">
116
  <?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
117
  <?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo esc_attr( $item['sku'] ); ?></dd><?php endif; ?>
119
  </dl>
120
  <?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
121
  </td>
122
+ <td class="quantity"><?php echo $item['quantity']; ?></td>
123
+ <td class="price"><?php echo $item['order_price']; ?></td>
124
  </tr>
125
  <?php endforeach; ?>
126
  </tbody>
149
  <tfoot>
150
  <?php foreach ( $this->get_woocommerce_totals() as $key => $total ) : ?>
151
  <tr class="<?php echo esc_attr( $key ); ?>">
152
+ <th class="description"><?php echo $total['label']; ?></th>
153
+ <td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
154
  </tr>
155
  <?php endforeach; ?>
156
  </tfoot>
templates/Simple/packing-slip.php CHANGED
@@ -73,7 +73,7 @@
73
  <?php if ( $shipping_method = $this->get_shipping_method() ) : ?>
74
  <tr class="shipping-method">
75
  <th><?php _e( 'Shipping Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
76
- <td><?php echo esc_html( $shipping_method ); ?></td>
77
  </tr>
78
  <?php endif; ?>
79
  <?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
@@ -96,9 +96,9 @@
96
  <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, esc_attr( $this->get_type() ), $this->order, $item_id ); ?>">
97
  <td class="product">
98
  <?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
99
- <span class="item-name"><?php echo esc_html( $item['name'] ); ?></span>
100
  <?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
101
- <span class="item-meta"><?php echo wp_kses_post( $item['meta'] ); ?></span>
102
  <dl class="meta">
103
  <?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
104
  <?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo esc_attr( $item['sku'] ); ?></dd><?php endif; ?>
@@ -106,7 +106,7 @@
106
  </dl>
107
  <?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
108
  </td>
109
- <td class="quantity"><?php echo esc_attr( $item['quantity'] ); ?></td>
110
  </tr>
111
  <?php endforeach; ?>
112
  </tbody>
73
  <?php if ( $shipping_method = $this->get_shipping_method() ) : ?>
74
  <tr class="shipping-method">
75
  <th><?php _e( 'Shipping Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
76
+ <td><?php echo $shipping_method; ?></td>
77
  </tr>
78
  <?php endif; ?>
79
  <?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
96
  <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, esc_attr( $this->get_type() ), $this->order, $item_id ); ?>">
97
  <td class="product">
98
  <?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
99
+ <span class="item-name"><?php echo $item['name']; ?></span>
100
  <?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
101
+ <span class="item-meta"><?php echo $item['meta']; ?></span>
102
  <dl class="meta">
103
  <?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
104
  <?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo esc_attr( $item['sku'] ); ?></dd><?php endif; ?>
106
  </dl>
107
  <?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
108
  </td>
109
+ <td class="quantity"><?php echo $item['quantity']; ?></td>
110
  </tr>
111
  <?php endforeach; ?>
112
  </tbody>
woocommerce-pdf-invoices-packingslips.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: PDF Invoices & Packing Slips for WooCommerce
4
  * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
- * Version: 3.2.2
7
  * Author: WP Overnight
8
  * Author URI: https://www.wpovernight.com
9
  * License: GPLv2 or later
@@ -21,7 +21,7 @@ if ( ! class_exists( 'WPO_WCPDF' ) ) :
21
 
22
  class WPO_WCPDF {
23
 
24
- public $version = '3.2.2';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
  public $legacy_textdomain;
3
  * Plugin Name: PDF Invoices & Packing Slips for WooCommerce
4
  * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
+ * Version: 3.2.3
7
  * Author: WP Overnight
8
  * Author URI: https://www.wpovernight.com
9
  * License: GPLv2 or later
21
 
22
  class WPO_WCPDF {
23
 
24
+ public $version = '3.2.3';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
  public $legacy_textdomain;