Flexible Shipping for WooCommerce - Version 1.9.11

Version Description

  • 2017-11-20 =
  • Fixed shipment filtering for shipping integrations
  • Fixed saving decimal values for free shipping
Download this release

Release Info

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

Code changes from version 1.9.10 to 1.9.11

classes/bulk-actions.php CHANGED
@@ -77,12 +77,12 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_Bulk_Actions' ) ) {
77
  $add_where_shipment_status = '';
78
  $add_where = '';
79
  if ( $integration != '' ) {
80
- $add_where_meta_integration = " EXISTS ( SELECT 1 FROM {$wpdb->postmeta} fs_postmeta WHERE wp_posts.ID = fs_postmeta.post_id AND fs_postmeta.meta_key = '_flexible_shipping_integration' AND fs_postmeta.meta_value = '$integration' ) ";
81
- $add_where_shipment_integration = " EXISTS ( SELECT 1 FROM {$wpdb->posts} fs_posts, {$wpdb->postmeta} fs_postmeta WHERE wp_posts.ID = fs_posts.post_parent AND fs_posts.ID = fs_postmeta.post_id AND fs_postmeta.meta_key = '_integration' AND fs_postmeta.meta_value = '$integration' ) ";
82
  }
83
  if ( $status != '' ) {
84
- $add_where_meta_status = " EXISTS ( SELECT 1 FROM {$wpdb->postmeta} fs_postmeta WHERE wp_posts.ID = fs_postmeta.post_id AND fs_postmeta.meta_key = '_flexible_shipping_status' AND fs_postmeta.meta_value = '$status' ) ";
85
- $add_where_shipment_status = " EXISTS ( SELECT 1 FROM {$wpdb->posts} fs_posts WHERE wp_posts.ID = fs_posts.post_parent AND fs_posts.post_status = 'fs-{$status}' ) ";
86
  }
87
  $add_where_meta = '';
88
  if ( $add_where_meta_integration != '' ) {
77
  $add_where_shipment_status = '';
78
  $add_where = '';
79
  if ( $integration != '' ) {
80
+ $add_where_meta_integration = " EXISTS ( SELECT 1 FROM {$wpdb->postmeta} fs_postmeta WHERE {$wpdb->posts}.ID = fs_postmeta.post_id AND fs_postmeta.meta_key = '_flexible_shipping_integration' AND fs_postmeta.meta_value = '$integration' ) ";
81
+ $add_where_shipment_integration = " EXISTS ( SELECT 1 FROM {$wpdb->posts} fs_posts, {$wpdb->postmeta} fs_postmeta WHERE {$wpdb->posts}.ID = fs_posts.post_parent AND fs_posts.ID = fs_postmeta.post_id AND fs_postmeta.meta_key = '_integration' AND fs_postmeta.meta_value = '$integration' ) ";
82
  }
83
  if ( $status != '' ) {
84
+ $add_where_meta_status = " EXISTS ( SELECT 1 FROM {$wpdb->postmeta} fs_postmeta WHERE {$wpdb->posts}.ID = fs_postmeta.post_id AND fs_postmeta.meta_key = '_flexible_shipping_status' AND fs_postmeta.meta_value = '$status' ) ";
85
+ $add_where_shipment_status = " EXISTS ( SELECT 1 FROM {$wpdb->posts} fs_posts WHERE {$wpdb->posts}.ID = fs_posts.post_parent AND fs_posts.post_status = 'fs-{$status}' ) ";
86
  }
87
  $add_where_meta = '';
88
  if ( $add_where_meta_integration != '' ) {
classes/shipping_method.php CHANGED
@@ -249,7 +249,7 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping' ) ) {
249
  $shipping_method['method_description'] = $_POST['woocommerce_' . $this->id . '_method_description'];
250
  $shipping_method['method_free_shipping'] = '';
251
  if ( isset( $_POST['woocommerce_' . $this->id . '_method_free_shipping'] ) && $_POST['woocommerce_' . $this->id . '_method_free_shipping'] != '' ) {
252
- $shipping_method['method_free_shipping'] = floatval( $_POST['woocommerce_' . $this->id . '_method_free_shipping'] );
253
  }
254
  if ( version_compare( WC()->version, '2.6' ) >= 0 ) {
255
  $shipping_method['method_free_shipping_label'] = $_POST['woocommerce_' . $this->id . '_method_free_shipping_label'];
249
  $shipping_method['method_description'] = $_POST['woocommerce_' . $this->id . '_method_description'];
250
  $shipping_method['method_free_shipping'] = '';
251
  if ( isset( $_POST['woocommerce_' . $this->id . '_method_free_shipping'] ) && $_POST['woocommerce_' . $this->id . '_method_free_shipping'] != '' ) {
252
+ $shipping_method['method_free_shipping'] = wc_format_decimal( $_POST['woocommerce_' . $this->id . '_method_free_shipping'] );
253
  }
254
  if ( version_compare( WC()->version, '2.6' ) >= 0 ) {
255
  $shipping_method['method_free_shipping_label'] = $_POST['woocommerce_' . $this->id . '_method_free_shipping_label'];
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.10
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
@@ -11,7 +11,7 @@
11
  Requires at least: 4.5
12
  Tested up to: 4.9
13
  WC requires at least: 2.6.14
14
- WC tested up to: 3.2.0
15
 
16
  Copyright 2017 WP Desk Ltd.
17
 
@@ -127,6 +127,10 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) && !class_exists(
127
  add_filter( 'flexible_shipping_value_in_currency', array( $this, 'flexible_shipping_value_in_currency_aelia' ), 1 );
128
  }
129
 
 
 
 
 
130
  if ( function_exists( 'wmcs_convert_price' ) ) {
131
  add_filter( 'flexible_shipping_value_in_currency', array( $this, 'flexible_shipping_value_in_currency_wmcs' ), 1 );
132
  }
@@ -579,6 +583,15 @@ if ( wpdesk_is_plugin_active( 'woocommerce/woocommerce.php' ) && !class_exists(
579
  return $value;
580
  }
581
 
 
 
 
 
 
 
 
 
 
582
  public function flexible_shipping_value_in_currency_wmcs( $value ) {
583
  $value = wmcs_convert_price( $value );
584
  return $value;
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.11
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
11
  Requires at least: 4.5
12
  Tested up to: 4.9
13
  WC requires at least: 2.6.14
14
+ WC tested up to: 3.2.4
15
 
16
  Copyright 2017 WP Desk Ltd.
17
 
127
  add_filter( 'flexible_shipping_value_in_currency', array( $this, 'flexible_shipping_value_in_currency_aelia' ), 1 );
128
  }
129
 
130
+ if ( class_exists( 'Aelia\WC\CurrencySwitcher\WC_Aelia_CurrencySwitcher' ) ) {
131
+ add_filter( 'flexible_shipping_value_in_currency', array( $this, 'flexible_shipping_value_in_currency_aelia_namespaces' ), 1 );
132
+ }
133
+
134
  if ( function_exists( 'wmcs_convert_price' ) ) {
135
  add_filter( 'flexible_shipping_value_in_currency', array( $this, 'flexible_shipping_value_in_currency_wmcs' ), 1 );
136
  }
583
  return $value;
584
  }
585
 
586
+ public function flexible_shipping_value_in_currency_aelia_namespaces( $value ) {
587
+ $aelia = Aelia\WC\CurrencySwitcher\WC_Aelia_CurrencySwitcher::instance();
588
+ $aelia_settings = Aelia\WC\CurrencySwitcher\WC_Aelia_CurrencySwitcher::settings();
589
+ $from_currency = $aelia_settings->base_currency();
590
+ $to_currency = $aelia->get_selected_currency();
591
+ $value = $aelia->convert( $value, $from_currency, $to_currency );
592
+ return $value;
593
+ }
594
+
595
  public function flexible_shipping_value_in_currency_wmcs( $value ) {
596
  $value = wmcs_convert_price( $value );
597
  return $value;
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.9
7
- Stable tag: 1.9.10
8
  Requires PHP: 5.3
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -165,6 +165,10 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
165
 
166
  == Changelog ==
167
 
 
 
 
 
168
  = 1.9.10 - 2017-10-10 =
169
  * Added support for WooCommerce 3.2
170
 
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.9
7
+ Stable tag: 1.9.11
8
  Requires PHP: 5.3
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
165
 
166
  == Changelog ==
167
 
168
+ = 1.9.11 - 2017-11-20 =
169
+ * Fixed shipment filtering for shipping integrations
170
+ * Fixed saving decimal values for free shipping
171
+
172
  = 1.9.10 - 2017-10-10 =
173
  * Added support for WooCommerce 3.2
174