Merge pull request #10794 from franticpsyx/fix-undefined-package-in-legacy-flat-rate
[2.6] Fix undefined package notice in legacy flat rate method
This commit is contained in:
commit
ba1caf3ecc
|
@ -276,15 +276,13 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method {
|
||||||
$extra_rate = $rate;
|
$extra_rate = $rate;
|
||||||
$extra_rate['id'] = $this->id . ':' . urldecode( sanitize_title( $this_option[0] ) );
|
$extra_rate['id'] = $this->id . ':' . urldecode( sanitize_title( $this_option[0] ) );
|
||||||
$extra_rate['label'] = $this_option[0];
|
$extra_rate['label'] = $this_option[0];
|
||||||
$extra_cost = $this->get_extra_cost( $this_option[1], $this_option[2], $package );
|
$extra_cost = $this->get_extra_cost( $this_option[1], $this_option[2], $rate['package'] );
|
||||||
if ( is_array( $extra_rate['cost'] ) ) {
|
if ( is_array( $extra_rate['cost'] ) ) {
|
||||||
$extra_rate['cost']['order'] = $extra_rate['cost']['order'] + $extra_cost;
|
$extra_rate['cost']['order'] = $extra_rate['cost']['order'] + $extra_cost;
|
||||||
} else {
|
} else {
|
||||||
$extra_rate['cost'] += $extra_cost;
|
$extra_rate['cost'] += $extra_cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rate['package'] = $package;
|
|
||||||
|
|
||||||
$this->add_rate( $extra_rate );
|
$this->add_rate( $extra_rate );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue