diff --git a/Makefile b/Makefile index 0b5ecaba9869efcae4e61a30852a54aaec1fae2f..87b5dedbbd235b3725a7b5e7f58e1c590d9d2d06 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ BASE=shipping-by-rules PLATTFORM=woocommerce VENDOR=opentools -VERSION=1.2.3 +VERSION=1.2.4 DIR = $(shell pwd) SVNDIR=wordpress-plugin-svn diff --git a/includes/rules-shipping-method.php b/includes/rules-shipping-method.php index f44293cc928b77a1eef0fc87d17710eefa2df95f..fe5f0f7420f7a5ee7476c470fabd4ff24bbfec01 100644 --- a/includes/rules-shipping-method.php +++ b/includes/rules-shipping-method.php @@ -25,7 +25,7 @@ class Shipping_by_Rules extends WC_Shipping_Method { } $this->helper = RulesShippingFrameworkWooCommerce::getHelper(); } - $this->id = 'shipping_by_rules'; // Id for your shipping method. Should be uunique. + $this->id = 'shipping_by_rules'; // Id for your shipping method. Should be unique. $this->title = $this->helper->__( 'Shipping By Rules'); $this->method_title = $this->helper->__( 'Shipping by Rules' ); // Title shown in admin $this->method_description = $this->helper->__( 'Define shipping costs by general, text-based rules.' ); // Description shown in admin @@ -153,8 +153,9 @@ class Shipping_by_Rules extends WC_Shipping_Method { $label .= ' (' . $r['rulename'] . ')'; } $rate = array( - 'id' => $r['method'], + 'id' => $this->id . $r['method'], 'label' => $label, + 'package' => $package, 'cost' => $r['cost'], // 'calc_tax' => 'per_item', ); diff --git a/includes/rules_shipping_framework_woocommerce.php b/includes/rules_shipping_framework_woocommerce.php index ca99e0b23a2b9a4e850356f069e15fdbe6fca078..1113d5afab7249627d813b541f4e72a55e39d9bd 100644 --- a/includes/rules_shipping_framework_woocommerce.php +++ b/includes/rules_shipping_framework_woocommerce.php @@ -349,7 +349,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { protected function addCustomCartValues ($cart, $products, $method, &$values) { } protected function addPluginCartValues($cart, $products, $method, &$values) { - return apply_filters( 'opentools_shipping_by_rules_get_cart_values', array(&$cartvals, $cart, $products, $method)); + return apply_filters( 'opentools_shipping_by_rules_get_cart_values', array(&$values, $cart, $products, $method)); } /** Filter the given array of products and return only those that belong to the categories, manufacturers, diff --git a/readme-adv.txt b/readme-adv.txt index 4f0b51d77819287180e28f824f9da29a28af6bc0..8ffee78437208ed284678f03c49a53ca9178bb2d 100644 --- a/readme-adv.txt +++ b/readme-adv.txt @@ -3,7 +3,7 @@ Contributors: opentools Tags: WooCommerce, Shipment, Shipping Requires at least: 4.0 Tested up to: 4.5 -Stable tag: 1.2.3 +Stable tag: 1.2.4 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl.html diff --git a/readme.txt b/readme.txt index 1ed28694e7c0aef37bd3b05df3cff00dc1006d25..f4596963a5eed5fb3a03d8719bc342351cdca9fa 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: opentools Tags: WooCommerce, Shipment, Shipping, Rules shipping Requires at least: 4.0 Tested up to: 4.5 -Stable tag: 1.2.3 +Stable tag: 1.2.4 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl.html @@ -69,6 +69,10 @@ Please see our support forum at http://open-tools.net/forum/. It might also be a == Changelog == += 1.2.4 = +* Fix incompatibility with Cash on Delivery (returned id should be prefixed with the method ID) +* Fix opentools_shipping_by_rules_get_cart_values filter using indefined argument + = 1.2.3 = * Fix update credentials input * Fix PHP error when both versions of the plugin are enabled diff --git a/releases/opentools-woocommerce-advanced-shipping-by-rules_v1.2.4.zip b/releases/opentools-woocommerce-advanced-shipping-by-rules_v1.2.4.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc978f7f5e4853bdcd343c636c299ef49bbe1baf Binary files /dev/null and b/releases/opentools-woocommerce-advanced-shipping-by-rules_v1.2.4.zip differ diff --git a/releases/opentools-woocommerce-shipping-by-rules_v1.2.4.zip b/releases/opentools-woocommerce-shipping-by-rules_v1.2.4.zip new file mode 100644 index 0000000000000000000000000000000000000000..ecce18ecc399b87c943b6796b6aaba6c4253720b Binary files /dev/null and b/releases/opentools-woocommerce-shipping-by-rules_v1.2.4.zip differ diff --git a/woocommerce-advanced-shipping-by-rules.php b/woocommerce-advanced-shipping-by-rules.php index a8c708fc310f8907e00116b9dafcf71e472bf758..b298db9f256a6145b258d2728847bf7ea48b7772 100644 --- a/woocommerce-advanced-shipping-by-rules.php +++ b/woocommerce-advanced-shipping-by-rules.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce Advanced Shipping By Rules * Plugin URI: http://open-tools.net/woocommerce/advanced-shipping-by-rules-for-woocommerce.html * Description: Define Shipping cost by very general and flexible (text-based) rules. The advanced version also provides mathematical expressions and functions - * Version: 1.2.3 + * Version: 1.2.4 * Author: Open Tools, Reinhold Kainhofer * Author URI: http://open-tools.net * Text Domain: woocommerce-advanced-shipping-by-rules @@ -75,7 +75,7 @@ class WooCommerce_Shipping_By_Rules_Advanced { * @since 1.0.0 * @var string $version Plugin version number. */ - public $version = '1.2.3'; + public $version = '1.2.4'; /** @@ -260,7 +260,7 @@ class WooCommerce_Shipping_By_Rules_Advanced { */ public function shipping_by_rules_add_shipping_method( $methods ) { if ( class_exists( 'Shipping_by_Rules' ) ) : - $methods[] = 'Shipping_by_Rules'; + $methods['shipping_by_rules'] = 'Shipping_by_Rules'; endif; // TODO: Figure out a way to add each shipping by rules method as a // separate WooCommerce shipping method (ie. their order can be diff --git a/woocommerce-shipping-by-rules.php b/woocommerce-shipping-by-rules.php index e332632e9049f1871765841740b1f325187a7638..aeedd91fa7e177f5e6eb241cd5f9426d2c771059 100644 --- a/woocommerce-shipping-by-rules.php +++ b/woocommerce-shipping-by-rules.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce Shipping By Rules * Plugin URI: http://open-tools.net/woocommerce/advanced-shipping-by-rules-for-woocommerce.html * Description: Define Shipping cost by very general and flexible (text-based) rules. - * Version: 1.2.3 + * Version: 1.2.4 * Author: Open Tools, Reinhold Kainhofer * Author URI: http://open-tools.net * Text Domain: woocommerce-shipping-by-rules @@ -48,7 +48,7 @@ class WooCommerce_Shipping_By_Rules { * @since 1.0.0 * @var string $version Plugin version number. */ - public $version = '1.2.3'; + public $version = '1.2.4'; /** @@ -235,7 +235,7 @@ class WooCommerce_Shipping_By_Rules { */ public function shipping_by_rules_add_shipping_method( $methods ) { if ( class_exists( 'Shipping_by_Rules' ) ) : - $methods[] = 'Shipping_by_Rules'; + $methods['shipping_by_rules'] = 'Shipping_by_Rules'; endif; // TODO: Figure out a way to add each shipping by rules method as a // separate WooCommerce shipping method (ie. their order can be