Printful Integration for WooCommerce - Version 2.1.10

Version Description

Improved shipping settings and status page, Woocommerce compatibility raised to 4.0

Download this release

Release Info

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

Code changes from version 2.1.9 to 2.1.10

i18n/languages/printful.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: \n"
5
- "POT-Creation-Date: 2019-09-24 16:42+0300\n"
6
  "PO-Revision-Date: 2018-04-26 13:50+0300\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
@@ -80,23 +80,28 @@ msgstr ""
80
  msgid "Personalization popup title text"
81
  msgstr ""
82
 
83
- #: includes/class-printful-admin-settings.php:161
84
- msgid "flat rates"
85
  msgstr ""
86
 
87
- #: includes/class-printful-admin-settings.php:165
88
- msgid "Shipping Methods"
 
 
 
 
 
89
  msgstr ""
90
 
91
- #: includes/class-printful-admin-settings.php:178
92
  msgid "You need to be connected to Printful API to edit carrier settings!"
93
  msgstr ""
94
 
95
- #: includes/class-printful-admin-settings.php:317
96
  msgid "International from USA"
97
  msgstr ""
98
 
99
- #: includes/class-printful-admin-settings.php:323
100
  msgid "International from EU"
101
  msgstr ""
102
 
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: \n"
5
+ "POT-Creation-Date: 2020-03-09 10:02+0200\n"
6
  "PO-Revision-Date: 2018-04-26 13:50+0300\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
80
  msgid "Personalization popup title text"
81
  msgstr ""
82
 
83
+ #: includes/class-printful-admin-settings.php:159
84
+ msgid "Shipping Methods"
85
  msgstr ""
86
 
87
+ #: includes/class-printful-admin-settings.php:160
88
+ msgid ""
89
+ "Here you can choose the shipping methods you want Printful to use for "
90
+ "shipping your orders.\n"
91
+ " Uncheck the ones you want to disable. From your selection, our "
92
+ "algorithm will determine the fastest, most cost-effective, and most reliable "
93
+ "method for each order."
94
  msgstr ""
95
 
96
+ #: includes/class-printful-admin-settings.php:166
97
  msgid "You need to be connected to Printful API to edit carrier settings!"
98
  msgstr ""
99
 
100
+ #: includes/class-printful-admin-settings.php:307
101
  msgid "International from USA"
102
  msgstr ""
103
 
104
+ #: includes/class-printful-admin-settings.php:313
105
  msgid "International from EU"
106
  msgstr ""
107
 
includes/class-printful-admin-settings.php CHANGED
@@ -155,22 +155,10 @@ class Printful_Admin_Settings {
155
  * @throws PrintfulException
156
  */
157
  public function setup_carrier_fields() {
158
- $flat_rate_link = sprintf(
159
- '<a href="%s" target="_blank">%s</a>',
160
- esc_url( 'https://www.printful.com/shipping' ),
161
- esc_html__( 'flat rates', 'printful' )
162
- );
163
-
164
  $carrier_settings = array(
165
  'title' => __( 'Shipping Methods', 'printful' ),
166
- 'description' => sprintf(
167
- "Here you can choose the shipping methods you want Printful to use for shipping your orders.
168
- Uncheck the ones you want to disable. From your selection, our algorithm will determine the fastest, most cost-effective, and most reliable method for each order. <br /><br />
169
- Checking “Flat Rate” enables Printful %s as a shipping option. When an order comes in and “Flat Rate” is the most cost-effective shipping option you’ve enabled, that’s the rate we’ll charge you.
170
- The order will be shipped with the least expensive shipping method available, regardless of what others you’ve enabled.
171
- So if you want to use only specific shipping methods, make sure “Flat Rate” is disabled.",
172
- $flat_rate_link
173
- ),
174
  'settings' => array(),
175
  );
176
 
@@ -210,10 +198,6 @@ class Printful_Admin_Settings {
210
  $us_carriers = $parsed_carriers['us_carriers'];
211
  $eu_carriers = $parsed_carriers['eu_carriers'];
212
 
213
- if ( empty( $us_carriers ) && empty( $eu_carriers ) ) {
214
- return false;
215
- }
216
-
217
  $saved_carriers = array_merge( $us_carriers, $eu_carriers );
218
  $request_body = array();
219
 
@@ -226,6 +210,11 @@ class Printful_Admin_Settings {
226
  $is_active = true;
227
  }
228
 
 
 
 
 
 
229
  $request_body[ $region ][ $carrier_type ][ $carrier_method ] = array(
230
  'isActive' => $is_active
231
  );
@@ -304,6 +293,7 @@ class Printful_Admin_Settings {
304
  $carrier_item = array(
305
  'label' => $carrier[ 'label' ] . ' <i>' . $carrier[ 'subtitle' ] . '</i>',
306
  'value' => ( $carrier[ 'isActive' ] == true ? 'yes' : 'no' ),
 
307
  );
308
 
309
  $carrier_regions[ $region ][ $carrier_type ][ $carrier['key'] ] = $carrier_item;
155
  * @throws PrintfulException
156
  */
157
  public function setup_carrier_fields() {
 
 
 
 
 
 
158
  $carrier_settings = array(
159
  'title' => __( 'Shipping Methods', 'printful' ),
160
+ 'description' => __( 'Here you can choose the shipping methods you want Printful to use for shipping your orders.
161
+ Uncheck the ones you want to disable. From your selection, our algorithm will determine the fastest, most cost-effective, and most reliable method for each order.', 'printful' ),
 
 
 
 
 
 
162
  'settings' => array(),
163
  );
164
 
198
  $us_carriers = $parsed_carriers['us_carriers'];
199
  $eu_carriers = $parsed_carriers['eu_carriers'];
200
 
 
 
 
 
201
  $saved_carriers = array_merge( $us_carriers, $eu_carriers );
202
  $request_body = array();
203
 
210
  $is_active = true;
211
  }
212
 
213
+ // `isDisabled` means that user is not allowed to change `isActive` state
214
+ if ($carrier_data['isDisabled']) {
215
+ $is_active = $carrier_data['isActive'];
216
+ }
217
+
218
  $request_body[ $region ][ $carrier_type ][ $carrier_method ] = array(
219
  'isActive' => $is_active
220
  );
293
  $carrier_item = array(
294
  'label' => $carrier[ 'label' ] . ' <i>' . $carrier[ 'subtitle' ] . '</i>',
295
  'value' => ( $carrier[ 'isActive' ] == true ? 'yes' : 'no' ),
296
+ 'isDisabled' => $carrier[ 'isDisabled' ]
297
  );
298
 
299
  $carrier_regions[ $region ][ $carrier_type ][ $carrier['key'] ] = $carrier_item;
includes/class-printful-admin-status.php CHANGED
@@ -568,7 +568,8 @@ class Printful_Admin_Status {
568
  */
569
  private function check_site_url_redirect()
570
  {
571
- $regular_site_url_req = wp_remote_head( get_option( 'siteurl' ), array('redirection' => 0));
 
572
 
573
  //need to not trigger issues for subfolder wordpress setups
574
  $slashed_site_url_req = wp_remote_head( trailingslashit(get_option( 'siteurl' )), array('redirection' => 0));
568
  */
569
  private function check_site_url_redirect()
570
  {
571
+
572
+ $regular_site_url_req = wp_remote_head( get_option( 'siteurl' ) . '/wp-json/', array('redirection' => 0));
573
 
574
  //need to not trigger issues for subfolder wordpress setups
575
  $slashed_site_url_req = wp_remote_head( trailingslashit(get_option( 'siteurl' )), array('redirection' => 0));
includes/templates/setting-group.php CHANGED
@@ -59,6 +59,9 @@
59
  <?php if ( $carrier['value'] == 'yes' ) {
60
  echo 'checked="checked"';
61
  } ?>
 
 
 
62
  >
63
  <?php echo wp_kses_post( $carrier['label'] ); ?>
64
  </label>
59
  <?php if ( $carrier['value'] == 'yes' ) {
60
  echo 'checked="checked"';
61
  } ?>
62
+ <?php if ( $carrier['isDisabled'] ) {
63
+ echo 'disabled="disabled"';
64
+ } ?>
65
  >
66
  <?php echo wp_kses_post( $carrier['label'] ); ?>
67
  </label>
printful-shipping.php CHANGED
@@ -3,13 +3,13 @@
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: 2.1.9
7
  Author: Printful
8
  Author URI: http://www.printful.com
9
  License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
10
  Text Domain: printful
11
  WC requires at least: 3.0.0
12
- WC tested up to: 3.9
13
  */
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -20,7 +20,7 @@ if ( ! defined( 'PF_PLUGIN_FILE' ) ) {
20
 
21
  class Printful_Base {
22
 
23
- const VERSION = '2.1.9';
24
  const PF_HOST = 'https://www.printful.com/';
25
  const PF_API_HOST = 'https://api.printful.com/';
26
 
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: 2.1.10
7
  Author: Printful
8
  Author URI: http://www.printful.com
9
  License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
10
  Text Domain: printful
11
  WC requires at least: 3.0.0
12
+ WC tested up to: 4.0
13
  */
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit;
20
 
21
  class Printful_Base {
22
 
23
+ const VERSION = '2.1.10';
24
  const PF_HOST = 'https://www.printful.com/';
25
  const PF_API_HOST = 'https://api.printful.com/';
26
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Printful Integration for WooCommerce ===
2
  Contributors: girts_u, kievins, kberzins
3
  Tags: woocommerce, printful, drop shipping, shipping, shipping rates, fulfillment, printing, fedex, carriers, checkout, t-shirts
4
- Requires at least: 4.4
5
- Tested up to: 5.3
6
  Requires PHP: 5.6
7
- Stable tag: 2.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -65,6 +65,9 @@ Go to https://www.printful.com/dashboard/store , select your WooCommerce store,
65
 
66
  == Upgrade Notice ==
67
 
 
 
 
68
  = 2.1.9 =
69
  Improved support for WooCommerce 3.9 and other minor bug fixes
70
 
@@ -169,6 +172,9 @@ First release
169
 
170
  == Changelog ==
171
 
 
 
 
172
  = 2.1.9 =
173
  * Improved support for WooCommerce 3.9 and other minor bug fixes
174
 
1
  === Printful Integration for WooCommerce ===
2
  Contributors: girts_u, kievins, kberzins
3
  Tags: woocommerce, printful, drop shipping, shipping, shipping rates, fulfillment, printing, fedex, carriers, checkout, t-shirts
4
+ Requires at least: 4.9
5
+ Tested up to: 5.4
6
  Requires PHP: 5.6
7
+ Stable tag: 2.1.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
65
 
66
  == Upgrade Notice ==
67
 
68
+ = 2.1.10 =
69
+ Improved shipping settings and status page, Woocommerce compatibility raised to 4.0
70
+
71
  = 2.1.9 =
72
  Improved support for WooCommerce 3.9 and other minor bug fixes
73
 
172
 
173
  == Changelog ==
174
 
175
+ = 2.1.10 =
176
+ * Improved support for WooCommerce 4.0 and other minor bug fixes
177
+
178
  = 2.1.9 =
179
  * Improved support for WooCommerce 3.9 and other minor bug fixes
180