WooCommerce PDF Invoices & Packing Slips - Version 1.5.2

Version Description

  • Fix: fatal error when trying to activate with WooCommerce not installed yet.
  • Tweak: indentation fix on the Simple template
Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

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.1
6
- Stable tag: 1.5.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -248,6 +248,10 @@ This usually only happens on batch actions. PDF creation is a memory intensive j
248
 
249
  == Changelog ==
250
 
 
 
 
 
251
  = 1.5.1 =
252
  * Fix: prevent errors when upgrading
253
 
@@ -463,5 +467,5 @@ This usually only happens on batch actions. PDF creation is a memory intensive j
463
 
464
  == Upgrade Notice ==
465
 
466
- = 1.5.1 =
467
  Version 1.5 changes where temporary files are stored - everything is now stored centrally in the WP uploads folder. For backwards compatibility, this feature is turned off by default, but we recommend to use the new folders. Check the plugin Status panel for more information!
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.1
6
+ Stable tag: 1.5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
248
 
249
  == Changelog ==
250
 
251
+ = 1.5.2 =
252
+ * Fix: fatal error when trying to activate with WooCommerce not installed yet.
253
+ * Tweak: indentation fix on the Simple template
254
+
255
  = 1.5.1 =
256
  * Fix: prevent errors when upgrading
257
 
467
 
468
  == Upgrade Notice ==
469
 
470
+ = 1.5.2 =
471
  Version 1.5 changes where temporary files are stored - everything is now stored centrally in the WP uploads folder. For backwards compatibility, this feature is turned off by default, but we recommend to use the new folders. Check the plugin Status panel for more information!
templates/pdf/Simple/invoice.php CHANGED
@@ -61,7 +61,8 @@
61
  </tr>
62
  </thead>
63
  <tbody>
64
- <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?><tr>
 
65
  <td class="description">
66
  <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
67
  <span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span>
@@ -73,7 +74,8 @@
73
  </td>
74
  <td class="quantity"><?php echo $item['quantity']; ?></td>
75
  <td class="price"><?php echo $item['order_price']; ?></td>
76
- </tr><?php endforeach; endif; ?>
 
77
  </tbody>
78
  <tfoot>
79
  <tr class="no-borders">
61
  </tr>
62
  </thead>
63
  <tbody>
64
+ <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?>
65
+ <tr>
66
  <td class="description">
67
  <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?>
68
  <span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span>
74
  </td>
75
  <td class="quantity"><?php echo $item['quantity']; ?></td>
76
  <td class="price"><?php echo $item['order_price']; ?></td>
77
+ </tr>
78
+ <?php endforeach; endif; ?>
79
  </tbody>
80
  <tfoot>
81
  <tr class="no-borders">
templates/pdf/Simple/packing-slip.php CHANGED
@@ -50,7 +50,8 @@
50
  </tr>
51
  </thead>
52
  <tbody>
53
- <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?><tr>
 
54
  <td class="description">
55
  <span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span>
56
  <dl class="meta">
@@ -59,7 +60,8 @@
59
  </dl>
60
  </td>
61
  <td class="quantity"><?php echo $item['quantity']; ?></td>
62
- </tr><?php endforeach; endif; ?>
 
63
  </tbody>
64
  </table><!-- order-details -->
65
 
50
  </tr>
51
  </thead>
52
  <tbody>
53
+ <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?>
54
+ <tr>
55
  <td class="description">
56
  <span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span>
57
  <dl class="meta">
60
  </dl>
61
  </td>
62
  <td class="quantity"><?php echo $item['quantity']; ?></td>
63
+ </tr>
64
+ <?php endforeach; endif; ?>
65
  </tbody>
66
  </table><!-- order-details -->
67
 
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.1
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.1';
37
 
38
  // load the localisation & classes
39
  add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?
@@ -135,6 +135,11 @@ if ( !class_exists( 'WooCommerce_PDF_Invoices' ) ) {
135
  * Handles version checking
136
  */
137
  public function do_install() {
 
 
 
 
 
138
  $version_setting = 'wpo_wcpdf_version';
139
  $installed_version = get_option( $version_setting );
140
 
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.2
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.2';
37
 
38
  // load the localisation & classes
39
  add_action( 'plugins_loaded', array( $this, 'translations' ) ); // or use init?
135
  * Handles version checking
136
  */
137
  public function do_install() {
138
+ // only install when woocommerce is active
139
+ if ( !$this->is_woocommerce_activated() ) {
140
+ return;
141
+ }
142
+
143
  $version_setting = 'wpo_wcpdf_version';
144
  $installed_version = get_option( $version_setting );
145