Skip to content
Snippets Groups Projects
Commit 3c3ac8e5 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V1.2.4: Fix incompatibility with Cash-On-Delivery; Fix filter using undefined argument

Fixes #6
parent f18b1658
No related branches found
No related tags found
No related merge requests found
BASE=shipping-by-rules
PLATTFORM=woocommerce
VENDOR=opentools
VERSION=1.2.3
VERSION=1.2.4
DIR = $(shell pwd)
SVNDIR=wordpress-plugin-svn
......
......@@ -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',
);
......
......@@ -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,
......
......@@ -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
......
......@@ -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
......
File added
File added
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment