Flexible Shipping for WooCommerce - Version 1.9.7

Version Description

  • 2017-08-09 =
  • Added compatibility with Flexible Shipping PRO 1.5
Download this release

Release Info

Developer wpdesk
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 1.9.7
Comparing to
See all releases

Code changes from version 1.9.6 to 1.9.7

assets/css/admin.css CHANGED
@@ -27,11 +27,27 @@ table.flexible_shipping_methods.wc_shipping th {
27
  }
28
 
29
  /* Rules Table */
 
 
 
 
 
30
  table.flexible_shipping_method_rules td p,
31
  table.flexible_shipping_method_rules td p input,
32
  table.flexible_shipping_method_rules td p select {
33
  margin: 0;
34
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
 
37
  table.flexible_shipping_method_rules td p input[type=checkbox] {
@@ -44,8 +60,31 @@ table.flexible_shipping_method_rules td {
44
  text-align: center;
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  .woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip {
48
  float: none;
 
49
  }
50
 
51
  .woocommerce table.form-table .flexible_shipping_method_rules .select2-container {
@@ -65,6 +104,14 @@ div.flexilble_shipping_export_import {
65
  float:right;
66
  }
67
 
 
 
 
 
 
 
 
 
68
  /* Ads */
69
  .woocommerce_page_wc-settings #mainform {
70
  position: relative;
27
  }
28
 
29
  /* Rules Table */
30
+
31
+ table.flexible_shipping_method_rules th, table.flexible_shipping_method_rules th {
32
+ padding: 5px 10px 5px 0px;
33
+ }
34
+
35
  table.flexible_shipping_method_rules td p,
36
  table.flexible_shipping_method_rules td p input,
37
  table.flexible_shipping_method_rules td p select {
38
  margin: 0;
39
  width: 100%;
40
+ box-shadow: none;
41
+ padding: 0px;
42
+ }
43
+
44
+ table.flexible_shipping_method_rules td p select {
45
+ margin: 0;
46
+ width: 100%;
47
+ box-shadow: none;
48
+ line-height: 28px;
49
+ height: 28px;
50
+ vertical-align: middle;;
51
  }
52
 
53
  table.flexible_shipping_method_rules td p input[type=checkbox] {
60
  text-align: center;
61
  }
62
 
63
+ table.flexible_shipping_method_rules th.shipping_class,
64
+ table.flexible_shipping_method_rules td.shipping_class {
65
+ text-align: center;
66
+ width: 200px;
67
+ }
68
+
69
+ table.flexible_shipping_method_rules td.shipping_class span {
70
+ border:none;
71
+ }
72
+
73
+ table.flexible_shipping_method_rules th.stop,
74
+ table.flexible_shipping_method_rules td.stop {
75
+ text-align: center;
76
+ width: 30px;
77
+ }
78
+
79
+ table.flexible_shipping_method_rules th.cancel,
80
+ table.flexible_shipping_method_rules td.cancel {
81
+ text-align: center;
82
+ width: 60px;
83
+ }
84
+
85
  .woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip {
86
  float: none;
87
+ margin: 0px;
88
  }
89
 
90
  .woocommerce table.form-table .flexible_shipping_method_rules .select2-container {
104
  float:right;
105
  }
106
 
107
+ table.flexible_shipping_method_rules tfoot th {
108
+ padding: 10px;
109
+ }
110
+
111
+ .fs_shipping_class {
112
+ /*width: 300px!important;*/
113
+ }
114
+
115
  /* Ads */
116
  .woocommerce_page_wc-settings #mainform {
117
  position: relative;
assets/css/admin.min.css CHANGED
@@ -1 +1 @@
1
- table.flexible_shipping_methods th.select,table.flexible_shipping_methods td.select{text-align:center;width:40px;margin-top:-7px;margin-left:-6px}table.flexible_shipping_methods .checkbox-select-all{margin:0 12px 0 8px}table.flexible_shipping_methods th.integration,table.flexible_shipping_methods td.integration{text-align:center;width:130px}table.flexible_shipping_methods tr.highlight td{background-color:#e4f2fd}table.flexible_shipping_methods.wc_shipping th{font-weight:400;width:auto}table.flexible_shipping_method_rules td p,table.flexible_shipping_method_rules td p input,table.flexible_shipping_method_rules td p select{margin:0;width:100%}table.flexible_shipping_method_rules td p input[type=checkbox]{margin:0;width:auto}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules td{text-align:center}.woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip{float:none}.woocommerce table.form-table .flexible_shipping_method_rules .select2-container{margin:0}.woocommerce table.form-table .fs-locations-table .select2-container{max-width:none}.woocommerce table.form-table .fs-locations-table th .woocommerce-help-tip{float:none}div.flexilble_shipping_export_import{float:right}.woocommerce_page_wc-settings #mainform{position:relative}.flexible-shipping-pro-box{max-width:280px;min-width:180px;right:0;position:absolute;top:155px}@media screen and (max-width:1199px){.flexible-shipping-pro-box{display:none}}.column-flexible_shipping{width:130px}.column-flexible_shipping .shipping-status{float:left;margin-right:8px;margin-top:4px;text-align:left;width:18px}.column-flexible_shipping .shipping-status .created:after{color:#d0c21f !important}.column-flexible_shipping .shipping-actions a.button{float:left;margin:0 4px 2px 0;display:block;height:2em !important;padding:0 !important;position:relative;text-indent:-9999px;width:2em}.column-flexible_shipping .shipping-actions a.button:after{font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.column-flexible_shipping .shipping-actions a.button.get-label:after{content:"\e01e"}.column-flexible_shipping .shipping-actions a.button.track:after{content:"\e01b"}.column-flexible_shipping mark.failed:after{color:#a00 !important}.column-flexible_shipping mark.manifest:after{color:#2ea2cc !important}.flexible_shipping_shipment_message{color:green}.flexible_shipping_shipment_message_error{color:red}
1
+ table.flexible_shipping_methods th.select,table.flexible_shipping_methods td.select{text-align:center;width:40px;margin-top:-7px;margin-left:-6px}table.flexible_shipping_methods .checkbox-select-all{margin:0 12px 0 8px}table.flexible_shipping_methods th.integration,table.flexible_shipping_methods td.integration{text-align:center;width:130px}table.flexible_shipping_methods tr.highlight td{background-color:#e4f2fd}table.flexible_shipping_methods.wc_shipping th{font-weight:400;width:auto}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules th{padding:5px 10px 5px 0}table.flexible_shipping_method_rules td p,table.flexible_shipping_method_rules td p input,table.flexible_shipping_method_rules td p select{margin:0;width:100%;box-shadow:none;padding:0}table.flexible_shipping_method_rules td p select{margin:0;width:100%;box-shadow:none;line-height:28px;height:28px;vertical-align:middle}table.flexible_shipping_method_rules td p input[type=checkbox]{margin:0;width:auto}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules td{text-align:center}table.flexible_shipping_method_rules th.shipping_class,table.flexible_shipping_method_rules td.shipping_class{text-align:center;width:200px}table.flexible_shipping_method_rules td.shipping_class span{border:0}table.flexible_shipping_method_rules th.stop,table.flexible_shipping_method_rules td.stop{text-align:center;width:30px}table.flexible_shipping_method_rules th.cancel,table.flexible_shipping_method_rules td.cancel{text-align:center;width:60px}.woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip{float:none;margin:0}.woocommerce table.form-table .flexible_shipping_method_rules .select2-container{margin:0}.woocommerce table.form-table .fs-locations-table .select2-container{max-width:none}.woocommerce table.form-table .fs-locations-table th .woocommerce-help-tip{float:none}div.flexilble_shipping_export_import{float:right}table.flexible_shipping_method_rules tfoot th{padding:10px}.woocommerce_page_wc-settings #mainform{position:relative}.flexible-shipping-pro-box{max-width:280px;min-width:180px;right:0;position:absolute;top:155px}@media screen and (max-width:1199px){.flexible-shipping-pro-box{display:none}}.column-flexible_shipping{width:130px}.column-flexible_shipping .shipping-status{float:left;margin-right:8px;margin-top:4px;text-align:left;width:18px}.column-flexible_shipping .shipping-status .created:after{color:#d0c21f !important}.column-flexible_shipping .shipping-actions a.button{float:left;margin:0 4px 2px 0;display:block;height:2em !important;padding:0 !important;position:relative;text-indent:-9999px;width:2em}.column-flexible_shipping .shipping-actions a.button:after{font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.column-flexible_shipping .shipping-actions a.button.get-label:after{content:"\e01e"}.column-flexible_shipping .shipping-actions a.button.track:after{content:"\e01b"}.column-flexible_shipping mark.failed:after{color:#a00 !important}.column-flexible_shipping mark.manifest:after{color:#2ea2cc !important}.flexible_shipping_shipment_message{color:green}.flexible_shipping_shipment_message_error{color:red}
classes/shipping_method.php CHANGED
@@ -445,19 +445,26 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
445
  $rule['shipping_class'] = trim( $csv_row['Shipping Class'] );
446
 
447
  if ( trim( $rule['shipping_class'] ) != '' ) {
448
- if ( !in_array( $rule['shipping_class'], array( 'all', 'any', 'none' ) ) ) {
449
- $shipping_class_found = false;
450
- $wc_shipping_classes = WC()->shipping->get_shipping_classes();
451
- foreach ( $wc_shipping_classes as $shipping_class ) {
452
- if ( $shipping_class->name == $rule['shipping_class'] ) {
453
- $rule['shipping_class'] = $shipping_class->term_id;
454
- $shipping_class_found = true;
 
 
 
 
455
  }
 
 
 
 
 
 
 
456
  }
457
- if ( !$shipping_class_found ) {
458
- $term_id = wp_insert_term( $rule['shipping_class'], 'product_shipping_class', array( 'description' => $rule['shipping_class'] ) );
459
- $rule['shipping_class'] = $term_id['term_id'];
460
- }
461
  }
462
  }
463
 
445
  $rule['shipping_class'] = trim( $csv_row['Shipping Class'] );
446
 
447
  if ( trim( $rule['shipping_class'] ) != '' ) {
448
+ $rule_shipping_classes = explode( ',', trim( $rule['shipping_class'] ) );
449
+ $rule['shipping_class'] = array();
450
+ foreach ( $rule_shipping_classes as $rule_shipping_class ) {
451
+ if ( !in_array( $rule_shipping_class, array( 'all', 'any', 'none' ) ) ) {
452
+ $shipping_class_found = false;
453
+ $wc_shipping_classes = WC()->shipping->get_shipping_classes();
454
+ foreach ( $wc_shipping_classes as $shipping_class ) {
455
+ if ( $shipping_class->name == $rule_shipping_class ) {
456
+ $rule['shipping_class'][] = $shipping_class->term_id;
457
+ $shipping_class_found = true;
458
+ }
459
  }
460
+ if ( !$shipping_class_found ) {
461
+ $term_id = wp_insert_term( $rule_shipping_class, 'product_shipping_class', array( 'description' => $rule_shipping_class ) );
462
+ $rule['shipping_class'][] = $term_id['term_id'];
463
+ }
464
+ }
465
+ else {
466
+ $rule['shipping_class'][] = $rule_shipping_class;
467
  }
 
 
 
 
468
  }
469
  }
470
 
classes/views/html-shipping-method-rules.php CHANGED
@@ -82,7 +82,7 @@
82
  <span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter maximum value for the "Based on" parameter.', 'flexible-shipping' ); ?>"></span>
83
  </th>
84
  <th class="cost_per_order">
85
- <?php _e( 'Cost per order', 'flexible-shipping' ); ?>
86
  <span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter shipment cost for this rule.', 'flexible-shipping' ); ?>"></span>
87
  </th>
88
  <?php do_action( 'flexible_shipping_method_rule_thead', '' ); ?>
@@ -195,6 +195,7 @@
195
  if ( size == 0 ) {
196
  append_id = append_id+1;
197
  append_row(append_id);
 
198
  }
199
  jQuery('#insert_rule').click(function() {
200
  append_id = append_id+1;
82
  <span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter maximum value for the "Based on" parameter.', 'flexible-shipping' ); ?>"></span>
83
  </th>
84
  <th class="cost_per_order">
85
+ <?php _e( 'Cost per<br/>order', 'flexible-shipping' ); ?>
86
  <span class="woocommerce-help-tip" data-tip="<?php _e( 'Enter shipment cost for this rule.', 'flexible-shipping' ); ?>"></span>
87
  </th>
88
  <?php do_action( 'flexible_shipping_method_rule_thead', '' ); ?>
195
  if ( size == 0 ) {
196
  append_id = append_id+1;
197
  append_row(append_id);
198
+ jQuery('#insert_rule').trigger( 'insert_rule' , [append_id] );
199
  }
200
  jQuery('#insert_rule').click(function() {
201
  append_id = append_id+1;
flexible-shipping.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
- Version: 1.9.6
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
@@ -54,7 +54,7 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) && !class_exists(
54
 
55
  class WPDesk_Flexible_Shipping_Free_Plugin extends inspire_Plugin4 {
56
 
57
- private $scripts_version = '31';
58
 
59
  protected $_pluginNamespace = "flexible-shipping";
60
 
@@ -335,11 +335,24 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) && !class_exists(
335
  $method_rule['shipping_class'] = '';
336
  }
337
  else {
 
 
 
 
 
 
 
 
 
 
 
338
  foreach ( $wc_shipping_classes as $shipping_class ) {
339
- if ( $shipping_class->term_id == $method_rule['shipping_class'] ) {
340
- $method_rule['shipping_class'] = $shipping_class->name;
 
341
  }
342
  }
 
343
  }
344
  if ( !isset( $method_rule['stop'] ) ) {
345
  $method_rule['stop'] = '';
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
+ Version: 1.9.7
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
54
 
55
  class WPDesk_Flexible_Shipping_Free_Plugin extends inspire_Plugin4 {
56
 
57
+ private $scripts_version = '34';
58
 
59
  protected $_pluginNamespace = "flexible-shipping";
60
 
335
  $method_rule['shipping_class'] = '';
336
  }
337
  else {
338
+ $method_shipping_class = $method_rule['shipping_class'];
339
+ if ( !is_array( $method_shipping_class ) ) {
340
+ $method_shipping_class = array( $method_shipping_class );
341
+ }
342
+ $method_rule['shipping_class'] = '';
343
+ foreach ( $method_shipping_class as $shipping_class ) {
344
+ if ( in_array( $shipping_class, array( 'none', 'any', 'all' ) ) ) {
345
+ $method_rule['shipping_class'] .= $shipping_class;
346
+ $method_rule['shipping_class'] .= ',';
347
+ }
348
+ }
349
  foreach ( $wc_shipping_classes as $shipping_class ) {
350
+ if ( in_array($shipping_class->term_id, $method_shipping_class ) ) {
351
+ $method_rule['shipping_class'] .= $shipping_class->name;
352
+ $method_rule['shipping_class'] .= ',';
353
  }
354
  }
355
+ $method_rule['shipping_class'] = trim( $method_rule['shipping_class'], ',' );
356
  }
357
  if ( !isset( $method_rule['stop'] ) ) {
358
  $method_rule['stop'] = '';
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdesk, swoboda, jablonowski, barczakszymon, ospiotr
3
  Donate link: https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.5
6
- Tested up to: 4.8
7
- Stable tag: 1.9.6
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -158,6 +158,9 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
158
 
159
  == Changelog ==
160
 
 
 
 
161
  = 1.9.6 - 2017-07-27 =
162
  * Fixed a problem with WPML when using multiple currencies
163
  * Fixed an error when product weight is not set
3
  Donate link: https://www.wpdesk.net/products/flexible-shipping-pro-woocommerce/
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.5
6
+ Tested up to: 4.8.1
7
+ Stable tag: 1.9.7
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
158
 
159
  == Changelog ==
160
 
161
+ = 1.9.7 - 2017-08-09 =
162
+ * Added compatibility with Flexible Shipping PRO 1.5
163
+
164
  = 1.9.6 - 2017-07-27 =
165
  * Fixed a problem with WPML when using multiple currencies
166
  * Fixed an error when product weight is not set