Merge branch 'master' of github.com:woothemes/woocommerce
This commit is contained in:
commit
45ddc1d26e
|
@ -16,6 +16,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*/
|
||||
class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
|
||||
|
||||
/**
|
||||
* Stores an array of rates
|
||||
* @var array
|
||||
*/
|
||||
public $flat_rates = array();
|
||||
|
||||
/**
|
||||
* __construct function.
|
||||
*
|
||||
|
@ -233,7 +239,6 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
|
|||
/**
|
||||
* order_shipping function.
|
||||
*
|
||||
* @access public
|
||||
* @param array $package
|
||||
* @return float
|
||||
*/
|
||||
|
@ -252,17 +257,15 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
|
|||
$cost = $this->flat_rates[ $shipping_class ]['cost'];
|
||||
$fee = $this->flat_rates[ $shipping_class ]['fee'];
|
||||
}
|
||||
} else {
|
||||
|
||||
// No matching classes so use defaults
|
||||
if ( ! empty( $this->cost ) && $this->cost > $cost ) {
|
||||
} elseif ( $this->cost > $cost ) {
|
||||
$cost = $this->cost;
|
||||
$fee = $this->fee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Default rates if set
|
||||
if ( is_null( $cost ) && $this->cost !== '' ) {
|
||||
$cost = $this->cost;
|
||||
|
|
Loading…
Reference in New Issue