WooCommerce PDF Invoices & Packing Slips - Version 2.14.5

Version Description

  • Fix: Preview invoice number & date display settings
  • Tested up to WooCommerce 6.5 & WordPress 6.0
Download this release

Release Info

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

Code changes from version 2.14.4 to 2.14.5

includes/documents/abstract-wcpdf-order-document.php CHANGED
@@ -130,33 +130,30 @@ abstract class Order_Document {
130
  $document_settings = get_option( 'wpo_wcpdf_documents_settings_'.$this->get_type() );
131
  $settings = (array) $document_settings + (array) $common_settings;
132
 
133
- // return only most current if forced
134
- if ( $latest == true ) {
135
- return $settings;
136
- }
137
-
138
- // get historical settings if enabled
139
- if ( ! empty( $this->order ) && $this->use_historical_settings() == true ) {
140
- $order_settings = WCX_Order::get_meta( $this->order, "_wcpdf_{$this->slug}_settings" );
141
- if ( ! empty( $order_settings ) && ! is_array( $order_settings ) ) {
142
- $order_settings = maybe_unserialize( $order_settings );
 
 
 
 
 
 
143
  }
144
- if ( ! empty( $order_settings ) && is_array( $order_settings ) ) {
145
- // ideally we should combine the order settings with the latest settings, so that new settings will
146
- // automatically be applied to existing orders too. However, doing this by combining arrays is not
147
- // possible because the way settings are currently stored means unchecked options are not included.
148
- // This means there is no way to tell whether an option didn't exist yet (in which case the new
149
- // option should be added) or whether the option was simly unchecked (in which case it should not
150
- // be overwritten). This can only be address by storing unchecked checkboxes too.
151
- $settings = (array) $order_settings + array_intersect_key( (array) $settings, array_flip( $this->get_non_historical_settings() ) );
152
  }
153
  }
154
- if ( $this->storing_settings_enabled() && empty( $order_settings ) && ! empty( $this->order ) ) {
155
- // this is either the first time the document is generated, or historical settings are disabled
156
- // in both cases, we store the document settings
157
- // exclude non historical settings from being saved in order meta
158
- WCX_Order::update_meta_data( $this->order, "_wcpdf_{$this->slug}_settings", array_diff_key( $settings, array_flip( $this->get_non_historical_settings() ) ) );
159
- }
160
 
161
  // display date & display number were checkbox settings but now a select setting that could be set but empty - should behave as 'unchecked'
162
  if ( array_key_exists( 'display_date', $settings ) && empty( $settings['display_date'] ) ) {
130
  $document_settings = get_option( 'wpo_wcpdf_documents_settings_'.$this->get_type() );
131
  $settings = (array) $document_settings + (array) $common_settings;
132
 
133
+ if ( $latest != true ) {
134
+ // get historical settings if enabled
135
+ if ( ! empty( $this->order ) && $this->use_historical_settings() == true ) {
136
+ $order_settings = WCX_Order::get_meta( $this->order, "_wcpdf_{$this->slug}_settings" );
137
+ if ( ! empty( $order_settings ) && ! is_array( $order_settings ) ) {
138
+ $order_settings = maybe_unserialize( $order_settings );
139
+ }
140
+ if ( ! empty( $order_settings ) && is_array( $order_settings ) ) {
141
+ // ideally we should combine the order settings with the latest settings, so that new settings will
142
+ // automatically be applied to existing orders too. However, doing this by combining arrays is not
143
+ // possible because the way settings are currently stored means unchecked options are not included.
144
+ // This means there is no way to tell whether an option didn't exist yet (in which case the new
145
+ // option should be added) or whether the option was simly unchecked (in which case it should not
146
+ // be overwritten). This can only be address by storing unchecked checkboxes too.
147
+ $settings = (array) $order_settings + array_intersect_key( (array) $settings, array_flip( $this->get_non_historical_settings() ) );
148
+ }
149
  }
150
+ if ( $this->storing_settings_enabled() && empty( $order_settings ) && ! empty( $this->order ) ) {
151
+ // this is either the first time the document is generated, or historical settings are disabled
152
+ // in both cases, we store the document settings
153
+ // exclude non historical settings from being saved in order meta
154
+ WCX_Order::update_meta_data( $this->order, "_wcpdf_{$this->slug}_settings", array_diff_key( $settings, array_flip( $this->get_non_historical_settings() ) ) );
 
 
 
155
  }
156
  }
 
 
 
 
 
 
157
 
158
  // display date & display number were checkbox settings but now a select setting that could be set but empty - should behave as 'unchecked'
159
  if ( array_key_exists( 'display_date', $settings ) && empty( $settings['display_date'] ) ) {
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: pomegranate, alexmigf, yordansoares, kluver, dpeyou
3
  Donate link: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
4
  Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
5
  Requires at least: 3.5
6
- Tested up to: 5.9
7
  Requires PHP: 7.1
8
- Stable tag: 2.14.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -102,6 +102,10 @@ There's a setting on the Status tab of the settings page that allows you to togg
102
 
103
  == Changelog ==
104
 
 
 
 
 
105
  = 2.14.4 =
106
  * Fix: Content-Length header causing invalid response on some servers
107
 
3
  Donate link: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
4
  Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
5
  Requires at least: 3.5
6
+ Tested up to: 6.0
7
  Requires PHP: 7.1
8
+ Stable tag: 2.14.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
102
 
103
  == Changelog ==
104
 
105
+ = 2.14.5 =
106
+ * Fix: Preview invoice number & date display settings
107
+ * Tested up to WooCommerce 6.5 & WordPress 6.0
108
+
109
  = 2.14.4 =
110
  * Fix: Content-Length header causing invalid response on some servers
111
 
woocommerce-pdf-invoices-packingslips.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
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: 2.14.4
7
  * Author: WP Overnight
8
  * Author URI: https://www.wpovernight.com
9
  * License: GPLv2 or later
10
  * License URI: https://opensource.org/licenses/gpl-license.php
11
  * Text Domain: woocommerce-pdf-invoices-packing-slips
12
  * WC requires at least: 2.2.0
13
- * WC tested up to: 6.4
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
@@ -21,7 +21,7 @@ if ( !class_exists( 'WPO_WCPDF' ) ) :
21
 
22
  class WPO_WCPDF {
23
 
24
- public $version = '2.14.4';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
  public $legacy_textdomain;
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
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: 2.14.5
7
  * Author: WP Overnight
8
  * Author URI: https://www.wpovernight.com
9
  * License: GPLv2 or later
10
  * License URI: https://opensource.org/licenses/gpl-license.php
11
  * Text Domain: woocommerce-pdf-invoices-packing-slips
12
  * WC requires at least: 2.2.0
13
+ * WC tested up to: 6.5
14
  */
15
 
16
  if ( ! defined( 'ABSPATH' ) ) {
21
 
22
  class WPO_WCPDF {
23
 
24
+ public $version = '2.14.5';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
  public $legacy_textdomain;