Plugin Directory

Changeset 2720557

Timestamp:
05/09/2022 10:19:52 AM (4 years ago)
Author:
pomegranate
Message:

v2.14.5

Location:
woocommerce-pdf-invoices-packing-slips/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-pdf-invoices-packing-slips/trunk/includes/documents/abstract-wcpdf-order-document.php

    r2705636 r2720557  
    131131        $settings = (array) $document_settings + (array) $common_settings;
    132132
    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            }
    159156        }
    160157
  • woocommerce-pdf-invoices-packing-slips/trunk/readme.txt

    r2705880 r2720557  
    44Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
    55Requires at least: 3.5
    6 Tested up to: 5.9
     6Tested up to:
    77Requires PHP: 7.1
    8 Stable tag: 2.14.4
     8Stable tag: 2.14.
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    102102
    103103== Changelog ==
     104
     105
     106
     107
    104108
    105109= 2.14.4 =
  • woocommerce-pdf-invoices-packing-slips/trunk/woocommerce-pdf-invoices-packingslips.php

    r2705880 r2720557  
    44 * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
    55 * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
    6  * Version: 2.14.4
     6 * Version: 2.14.
    77 * Author: WP Overnight
    88 * Author URI: https://www.wpovernight.com
     
    1111 * Text Domain: woocommerce-pdf-invoices-packing-slips
    1212 * WC requires at least: 2.2.0
    13  * WC tested up to: 6.4
     13 * WC tested up to: 6.
    1414 */
    1515
     
    2222class WPO_WCPDF {
    2323
    24     public $version = '2.14.4';
     24    public $version = '2.14.';
    2525    public $plugin_basename;
    2626    public $legacy_mode;
Note: See TracChangeset for help on using the changeset viewer.