WooCommerce PDF Invoices & Packing Slips - Version 1.6.3

Version Description

  • Fix: Empty date handling
  • Fix: Shipping notes on refunds (reason for refund)
Download this release

Release Info

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

Code changes from version 1.6.2 to 1.6.3

includes/class-wcpdf-functions.php CHANGED
@@ -749,7 +749,19 @@ class WooCommerce_PDF_Invoices_Functions {
749
  * Return/Show shipping notes
750
  */
751
  public function get_shipping_notes() {
752
- $shipping_notes = wpautop( wptexturize( WCX_Order::get_prop( WPO_WCPDF()->export->order, 'customer_note', 'view' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
753
  return apply_filters( 'wpo_wcpdf_shipping_notes', $shipping_notes );
754
  }
755
  public function shipping_notes() {
749
  * Return/Show shipping notes
750
  */
751
  public function get_shipping_notes() {
752
+ $order_id = WCX_Order::get_id( WPO_WCPDF()->export->order );
753
+ if ( get_post_type( $order_id ) == 'shop_order_refund' ) {
754
+ // return reason for refund if order is a refund
755
+ if ( version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {
756
+ $shipping_notes = WPO_WCPDF()->export->order->get_reason();
757
+ } elseif ( method_exists(WPO_WCPDF()->export->order, 'get_refund_reason') ) {
758
+ $shipping_notes = WPO_WCPDF()->export->order->get_refund_reason();
759
+ } else {
760
+ $shipping_notes = wpautop( wptexturize( WCX_Order::get_prop( WPO_WCPDF()->export->order, 'customer_note', 'view' ) ) );
761
+ }
762
+ } else {
763
+ $shipping_notes = wpautop( wptexturize( WCX_Order::get_prop( WPO_WCPDF()->export->order, 'customer_note', 'view' ) ) );
764
+ }
765
  return apply_filters( 'wpo_wcpdf_shipping_notes', $shipping_notes );
766
  }
767
  public function shipping_notes() {
includes/compatibility/class-wc-order-compatibility.php CHANGED
@@ -82,7 +82,7 @@ class Order extends Data {
82
  $value = parent::get_prop( $object, $prop, $context, self::$compat_props );
83
 
84
  // 3.0+ date getters return a DateTime object, where previously MySQL date strings were returned
85
- if ( WC_Core::is_wc_version_lt_3_0() && in_array( $prop, array( 'date_completed', 'date_paid', 'date_modified', 'date_created' ), true ) && ! is_numeric( $value ) ) {
86
  if ( is_numeric( $value ) ) {
87
  $value = new WC_DateTime( "@{$value}", new \DateTimeZone( 'UTC' ) );
88
  $value->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
82
  $value = parent::get_prop( $object, $prop, $context, self::$compat_props );
83
 
84
  // 3.0+ date getters return a DateTime object, where previously MySQL date strings were returned
85
+ if ( WC_Core::is_wc_version_lt_3_0() && in_array( $prop, array( 'date_completed', 'date_paid', 'date_modified', 'date_created' ), true ) && !empty( $value ) ) {
86
  if ( is_numeric( $value ) ) {
87
  $value = new WC_DateTime( "@{$value}", new \DateTimeZone( 'UTC' ) );
88
  $value->setTimezone( new \DateTimeZone( wc_timezone_string() ) );
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.7
6
- Stable tag: 1.6.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -99,6 +99,10 @@ There's a setting on the Status tab of the settings page that allows you to togg
99
 
100
  == Changelog ==
101
 
 
 
 
 
102
  = 1.6.2 =
103
  * Fix: TM Extra Product Options compatibility (in WC3.0)
104
  * Fix: Tax display in WC3.0
@@ -528,5 +532,5 @@ There's a setting on the Status tab of the settings page that allows you to togg
528
 
529
  == Upgrade Notice ==
530
 
531
- = 1.6.2 =
532
  Important: Version 1.6 requires PHP 5.3 or higher to run!
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.7
6
+ Stable tag: 1.6.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
99
 
100
  == Changelog ==
101
 
102
+ = 1.6.3 =
103
+ * Fix: Empty date handling
104
+ * Fix: Shipping notes on refunds (reason for refund)
105
+
106
  = 1.6.2 =
107
  * Fix: TM Extra Product Options compatibility (in WC3.0)
108
  * Fix: Tax display in WC3.0
532
 
533
  == Upgrade Notice ==
534
 
535
+ = 1.6.3 =
536
  Important: Version 1.6 requires PHP 5.3 or higher to run!
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.6.2
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later
@@ -48,7 +48,7 @@ if ( !class_exists( 'WooCommerce_PDF_Invoices' ) ) {
48
  self::$plugin_basename = plugin_basename(__FILE__);
49
  self::$plugin_url = plugin_dir_url(self::$plugin_basename);
50
  self::$plugin_path = trailingslashit(dirname(__FILE__));
51
- self::$version = '1.6.2';
52
 
53
  // load the localisation & classes
54
  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.6.3
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later
48
  self::$plugin_basename = plugin_basename(__FILE__);
49
  self::$plugin_url = plugin_dir_url(self::$plugin_basename);
50
  self::$plugin_path = trailingslashit(dirname(__FILE__));
51
+ self::$version = '1.6.3';
52
 
53
  // load the localisation & classes
54
  add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?