WooCommerce PDF Invoices & Packing Slips - Version 1.5.17

Version Description

  • Feature: WooCommerce Product Bundles compatibility styles
  • Tweak: wpo_wcpdf_item_row_class as filter instead of action
Download this release

Release Info

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

Code changes from version 1.5.16 to 1.5.17

includes/class-wcpdf-export.php CHANGED
@@ -68,6 +68,12 @@ if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
68
  add_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'reset_invoice_data' ), 10, 4 );
69
  }
70
 
 
 
 
 
 
 
71
  }
72
 
73
  /**
@@ -966,6 +972,18 @@ if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
966
 
967
  return $thumbnail;
968
  }
 
 
 
 
 
 
 
 
 
 
 
 
969
 
970
  public function enable_debug () {
971
  error_reporting( E_ALL );
68
  add_action( 'woocommerce_subscriptions_renewal_order_created', array( $this, 'reset_invoice_data' ), 10, 4 );
69
  }
70
 
71
+ // WooCommerce Product Bundles compatibility (add row classes)
72
+
73
+ if ( class_exists('WC_Bundles') ) {
74
+ add_filter( 'wpo_wcpdf_item_row_class', array( $this, 'add_product_bundles_classes' ), 10, 3 );
75
+ }
76
+
77
  }
78
 
79
  /**
972
 
973
  return $thumbnail;
974
  }
975
+
976
+ public function add_product_bundles_classes ( $item_id, $template_type, $order ) {
977
+ $item_meta = $order->get_item_meta( $item_id );
978
+
979
+ if (isset($item_meta['_bundled_by'])) {
980
+ return $item_id . ' bundled-item';
981
+ } elseif (isset($item_meta['_bundled_items'])) {
982
+ return $item_id . ' product-bundle';
983
+ }
984
+
985
+ return $item_id;
986
+ }
987
 
988
  public function enable_debug () {
989
  error_reporting( E_ALL );
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.2
6
- Stable tag: 1.5.16
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -235,6 +235,10 @@ This usually only happens on batch actions. PDF creation is a memory intensive j
235
 
236
  == Changelog ==
237
 
 
 
 
 
238
  = 1.5.16 =
239
  * Feature: Search orders by invoice number (note: search on formatted invoice number only works for new orders)
240
  * Feature: Formatted invoice number stored in order
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.2
6
+ Stable tag: 1.5.17
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.17 =
239
+ * Feature: WooCommerce Product Bundles compatibility styles
240
+ * Tweak: wpo_wcpdf_item_row_class as filter instead of action
241
+
242
  = 1.5.16 =
243
  * Feature: Search orders by invoice number (note: search on formatted invoice number only works for new orders)
244
  * Feature: Formatted invoice number stored in order
templates/pdf/Simple/invoice.php CHANGED
@@ -86,7 +86,7 @@
86
  </thead>
87
  <tbody>
88
  <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
89
- <tr class="<?php do_action( 'wpo_wcpdf_item_row_class', $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order ); ?>">
90
  <td class="product">
91
  <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
92
  <span class="item-name"><?php echo $item['name']; ?></span>
86
  </thead>
87
  <tbody>
88
  <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
89
+ <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order ); ?>">
90
  <td class="product">
91
  <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
92
  <span class="item-name"><?php echo $item['name']; ?></span>
templates/pdf/Simple/packing-slip.php CHANGED
@@ -73,7 +73,7 @@
73
  </thead>
74
  <tbody>
75
  <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
76
- <tr class="<?php do_action( 'wpo_wcpdf_item_row_class', $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order ); ?>">
77
  <td class="product">
78
  <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
79
  <span class="item-name"><?php echo $item['name']; ?></span>
73
  </thead>
74
  <tbody>
75
  <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
76
+ <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $wpo_wcpdf->export->template_type, $item, $wpo_wcpdf->export->order ); ?>">
77
  <td class="product">
78
  <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
79
  <span class="item-name"><?php echo $item['name']; ?></span>
templates/pdf/Simple/style.css CHANGED
@@ -192,6 +192,23 @@ table.order-details {
192
  border-color: black;
193
  }
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
 
196
  dl {
197
  margin: 4px 0;
192
  border-color: black;
193
  }
194
 
195
+ /* product bundles compatibility */
196
+ .order-details tr.bundled-item td.product {
197
+ padding-left: 5mm;
198
+ }
199
+
200
+ .order-details tr.product-bundle td,
201
+ .order-details tr.product-bundle th,
202
+ .order-details tr.bundled-item td,
203
+ .order-details tr.bundled-item th {
204
+ border-bottom: 0;
205
+ }
206
+
207
+ .order-details tr.bundled-item:last-child td,
208
+ .order-details tr.bundled-item:last-child th {
209
+ border-bottom: 1px #ccc solid;
210
+ }
211
+
212
 
213
  dl {
214
  margin: 4px 0;
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.16
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.16';
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.17
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.17';
37
 
38
  // load the localisation & classes
39
  add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?