Printful Integration for WooCommerce - Version 1.2.4

Version Description

Prevent virtual products from requiring shipping rate when bought together with Printful products

Download this release

Release Info

Developer printful
Plugin Icon 128x128 Printful Integration for WooCommerce
Version 1.2.4
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.4

includes/class-printful-shipping.php CHANGED
@@ -133,17 +133,31 @@ class Printful_Shipping extends WC_Shipping_Method
133
  }
134
  $new_contents = array(
135
  'printful' => array(),
 
136
  'woocommerce' => array()
137
  );
138
 
139
  foreach($ids as $key => $external_id) {
 
140
  if(in_array($external_id,$printful_ids)) {
141
- $new_contents['printful'][$key] = $package['contents'][$key];
 
 
142
  } else {
143
- $new_contents['woocommerce'][$key] = $package['contents'][$key];
144
  }
145
  }
146
 
 
 
 
 
 
 
 
 
 
 
147
  foreach ($new_contents as $key => $contents) {
148
  if($contents) {
149
  $new_package = $package;
133
  }
134
  $new_contents = array(
135
  'printful' => array(),
136
+ 'virtual' => array(),
137
  'woocommerce' => array()
138
  );
139
 
140
  foreach($ids as $key => $external_id) {
141
+ $item = $package['contents'][$key];
142
  if(in_array($external_id,$printful_ids)) {
143
+ $new_contents['printful'][$key] = $item;
144
+ } else if($item['data']->is_virtual() || $item['data']->is_downloadable()) {
145
+ $new_contents['virtual'][$key] = $item;
146
  } else {
147
+ $new_contents['woocommerce'][$key] = $item;
148
  }
149
  }
150
 
151
+ //Put virtual products together with any other package
152
+ if($new_contents['virtual']) {
153
+ if($new_contents['printful'] && !$new_contents['woocommerce']) {
154
+ $new_contents['printful'] += $new_contents['virtual'];
155
+ } else {
156
+ $new_contents['woocommerce'] += $new_contents['virtual'];
157
+ }
158
+ unset ($new_contents['virtual']);
159
+ }
160
+
161
  foreach ($new_contents as $key => $contents) {
162
  if($contents) {
163
  $new_package = $package;
printful-shipping.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Printful Integration for WooCommerce
4
  Plugin URI: https://wordpress.org/plugins/printful-shipping-for-woocommerce/
5
  Description: Calculate correct shipping and tax rates for your Printful-Woocommerce integration.
6
- Version: 1.2.3
7
  Author: Printful
8
  Author URI: http://www.theprintful.com
9
  License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
@@ -16,7 +16,7 @@ new Printful_Base();
16
 
17
  class Printful_Base {
18
 
19
- const VERSION = '1.2.3';
20
 
21
  /**
22
  * Construct the plugin.
3
  Plugin Name: Printful Integration for WooCommerce
4
  Plugin URI: https://wordpress.org/plugins/printful-shipping-for-woocommerce/
5
  Description: Calculate correct shipping and tax rates for your Printful-Woocommerce integration.
6
+ Version: 1.2.4
7
  Author: Printful
8
  Author URI: http://www.theprintful.com
9
  License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
16
 
17
  class Printful_Base {
18
 
19
+ const VERSION = '1.2.4';
20
 
21
  /**
22
  * Construct the plugin.
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: girts_u
3
  Tags: woocommerce, printful, drop shipping, shipping, shipping rates, fulfillment, printing, fedex, carriers, checkout, t-shirts
4
  Requires at least: 3.8
5
  Tested up to: 4.5.2
6
- Stable tag: 1.2.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -40,10 +40,12 @@ Go to https://www.theprintful.com/dashboard/store , select your WooCommerce stor
40
  3. Shipping rate selection
41
 
42
  == Upgrade Notice ==
43
-
 
 
44
 
45
  = 1.2.3 =
46
- Fixed issue introduced in 1.2.2
47
 
48
  = 1.2.2 =
49
  Fixed PHP warning on Woocommerce 2.6
@@ -73,9 +75,12 @@ Minor improvements
73
  First release
74
 
75
  == Changelog ==
76
-
 
 
 
77
  = 1.2.3 =
78
- * Fixed issue introduced in 1.2.2
79
 
80
  = 1.2.2 =
81
  * Fixed PHP warning on Woocommerce 2.6 due to changed method signature
3
  Tags: woocommerce, printful, drop shipping, shipping, shipping rates, fulfillment, printing, fedex, carriers, checkout, t-shirts
4
  Requires at least: 3.8
5
  Tested up to: 4.5.2
6
+ Stable tag: 1.2.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
40
  3. Shipping rate selection
41
 
42
  == Upgrade Notice ==
43
+
44
+ = 1.2.4 =
45
+ Prevent virtual products from requiring shipping rate when bought together with Printful products
46
 
47
  = 1.2.3 =
48
+ Fixed issue introduced in 1.2.2
49
 
50
  = 1.2.2 =
51
  Fixed PHP warning on Woocommerce 2.6
75
  First release
76
 
77
  == Changelog ==
78
+
79
+ = 1.2.4 =
80
+ * Prevent virtual products from requiring shipping rate when bought together with Printful products
81
+
82
  = 1.2.3 =
83
+ * Fixed issue introduced in 1.2.2
84
 
85
  = 1.2.2 =
86
  * Fixed PHP warning on Woocommerce 2.6 due to changed method signature