WooCommerce PDF Invoices & Packing Slips - Version 1.5.24

Version Description

  • Hotfix: Subscriptions renewal filter arguments
Download this release

Release Info

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

Code changes from version 1.5.23 to 1.5.24

includes/class-wcpdf-export.php CHANGED
@@ -67,9 +67,9 @@ if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
67
  // WooCommerce Subscriptions compatibility
68
  if ( class_exists('WC_Subscriptions') ) {
69
  if ( version_compare( WC_Subscriptions::$version, '2.0', '<' ) ) {
70
- add_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'reset_invoice_data' ), 10, 4 );
71
  } else {
72
- add_action( 'wcs_renewal_order_created', array( $this, 'reset_invoice_data' ), 10, 4 );
73
  }
74
  }
75
 
@@ -627,16 +627,24 @@ if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
627
  * Reset invoice data for WooCommerce subscription renewal orders
628
  * https://wordpress.org/support/topic/subscription-renewal-duplicate-invoice-number?replies=6#post-6138110
629
  */
630
- public function reset_invoice_data ( $renewal_order, $original_order, $product_id, $new_order_role ) {
631
- // delete invoice number, invoice date & invoice exists meta
632
- delete_post_meta( $renewal_order->id, '_wcpdf_invoice_number' );
633
- delete_post_meta( $renewal_order->id, '_wcpdf_formatted_invoice_number' );
634
- delete_post_meta( $renewal_order->id, '_wcpdf_invoice_date' );
635
- delete_post_meta( $renewal_order->id, '_wcpdf_invoice_exists' );
636
 
 
 
637
  return $renewal_order;
638
  }
639
 
 
 
 
 
 
 
 
 
640
  public function format_invoice_number( $invoice_number, $order_number, $order_id, $order_date ) {
641
  // get format settings
642
  $order_year = date_i18n( 'Y', strtotime( $order_date ) );
67
  // WooCommerce Subscriptions compatibility
68
  if ( class_exists('WC_Subscriptions') ) {
69
  if ( version_compare( WC_Subscriptions::$version, '2.0', '<' ) ) {
70
+ add_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'woocommerce_subscriptions_renewal_order_created' ), 10, 4 );
71
  } else {
72
+ add_action( 'wcs_renewal_order_created', array( $this, 'wcs_renewal_order_created' ), 10, 2 );
73
  }
74
  }
75
 
627
  * Reset invoice data for WooCommerce subscription renewal orders
628
  * https://wordpress.org/support/topic/subscription-renewal-duplicate-invoice-number?replies=6#post-6138110
629
  */
630
+ public function woocommerce_subscriptions_renewal_order_created ( $renewal_order, $original_order, $product_id, $new_order_role ) {
631
+ $this->reset_invoice_data( $renewal_order->id );
632
+ return $renewal_order;
633
+ }
 
 
634
 
635
+ public function wcs_renewal_order_created ( $renewal_order, $subscription ) {
636
+ $this->reset_invoice_data( $renewal_order->id );
637
  return $renewal_order;
638
  }
639
 
640
+ public function reset_invoice_data ( $order_id ) {
641
+ // delete invoice number, invoice date & invoice exists meta
642
+ delete_post_meta( $order_id, '_wcpdf_invoice_number' );
643
+ delete_post_meta( $order_id, '_wcpdf_formatted_invoice_number' );
644
+ delete_post_meta( $order_id, '_wcpdf_invoice_date' );
645
+ delete_post_meta( $order_id, '_wcpdf_invoice_exists' );
646
+ }
647
+
648
  public function format_invoice_number( $invoice_number, $order_number, $order_id, $order_date ) {
649
  // get format settings
650
  $order_year = date_i18n( 'Y', strtotime( $order_date ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: pomegranate
3
  Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
4
  Requires at least: 3.5
5
  Tested up to: 4.3.1
6
- Stable tag: 1.5.23
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -235,6 +235,9 @@ This usually only happens on batch actions. PDF creation is a memory intensive j
235
 
236
  == Changelog ==
237
 
 
 
 
238
  = 1.5.23 =
239
  * Fix: WooCommerce Subscriptons 2.0 deprecation notice.
240
  * Tweak: better qTranslate-X support
3
  Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice, packing slip, export, email, bulk, automatic
4
  Requires at least: 3.5
5
  Tested up to: 4.3.1
6
+ Stable tag: 1.5.24
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
235
 
236
  == Changelog ==
237
 
238
+ = 1.5.24 =
239
+ * Hotfix: Subscriptions renewal filter arguments
240
+
241
  = 1.5.23 =
242
  * Fix: WooCommerce Subscriptons 2.0 deprecation notice.
243
  * Tweak: better qTranslate-X support
woocommerce-pdf-invoices-packingslips.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: http://www.wpovernight.com
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
- * Version: 1.5.23
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later
@@ -33,7 +33,7 @@ if ( !class_exists( 'WooCommerce_PDF_Invoices' ) ) {
33
  self::$plugin_basename = plugin_basename(__FILE__);
34
  self::$plugin_url = plugin_dir_url(self::$plugin_basename);
35
  self::$plugin_path = trailingslashit(dirname(__FILE__));
36
- self::$version = '1.5.23';
37
 
38
  // load the localisation & classes
39
  add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: http://www.wpovernight.com
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
+ * Version: 1.5.24
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later
33
  self::$plugin_basename = plugin_basename(__FILE__);
34
  self::$plugin_url = plugin_dir_url(self::$plugin_basename);
35
  self::$plugin_path = trailingslashit(dirname(__FILE__));
36
+ self::$version = '1.5.24';
37
 
38
  // load the localisation & classes
39
  add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?