Changeset 2720557
- Timestamp:
- 05/09/2022 10:19:52 AM (4 years ago)
- Location:
- woocommerce-pdf-invoices-packing-slips/trunk
- Files:
-
- 3 edited
-
includes/documents/abstract-wcpdf-order-document.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
woocommerce-pdf-invoices-packingslips.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-pdf-invoices-packing-slips/trunk/includes/documents/abstract-wcpdf-order-document.php
r2705636 r2720557 131 131 $settings = (array) $document_settings + (array) $common_settings; 132 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() ) ) ); 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 } 159 156 } 160 157 -
woocommerce-pdf-invoices-packing-slips/trunk/readme.txt
r2705880 r2720557 4 4 Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic 5 5 Requires at least: 3.5 6 Tested up to: 5.96 Tested up to: 7 7 Requires PHP: 7.1 8 Stable tag: 2.14. 48 Stable tag: 2.14. 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 102 102 103 103 == Changelog == 104 105 106 107 104 108 105 109 = 2.14.4 = -
woocommerce-pdf-invoices-packing-slips/trunk/woocommerce-pdf-invoices-packingslips.php
r2705880 r2720557 4 4 * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/ 5 5 * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders. 6 * Version: 2.14. 46 * Version: 2.14. 7 7 * Author: WP Overnight 8 8 * Author URI: https://www.wpovernight.com … … 11 11 * Text Domain: woocommerce-pdf-invoices-packing-slips 12 12 * WC requires at least: 2.2.0 13 * WC tested up to: 6. 413 * WC tested up to: 6. 14 14 */ 15 15 … … 22 22 class WPO_WCPDF { 23 23 24 public $version = '2.14. 4';24 public $version = '2.14.'; 25 25 public $plugin_basename; 26 26 public $legacy_mode;
Note: See TracChangeset
for help on using the changeset viewer.