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:
Claudio Sanches 2016-04-26 13:13:05 -03:00
commit ba1caf3ecc
1 changed files with 1 additions and 3 deletions

View File

@ -276,15 +276,13 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method {
$extra_rate = $rate;
$extra_rate['id'] = $this->id . ':' . urldecode( sanitize_title( $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'] ) ) {
$extra_rate['cost']['order'] = $extra_rate['cost']['order'] + $extra_cost;
} else {
$extra_rate['cost'] += $extra_cost;
}
$rate['package'] = $package;
$this->add_rate( $extra_rate );
}
}