Fix fatal error on order tax calculations

Fix "PHP Fatal error: Call to a member function get_total() on array"
by using the shipping line items cost index instead of attempting
to call a method on it which does not exist (because it's an array)
This commit is contained in:
Brent Shepherd 2016-05-16 22:22:53 -07:00
parent 94a9c649ba
commit 29692a22c5
1 changed files with 1 additions and 1 deletions

View File

@ -762,7 +762,7 @@ abstract class WC_Abstract_Order {
) );
}
$line_taxes = WC_Tax::calc_tax( $item->get_total(), $tax_rates, false );
$line_taxes = WC_Tax::calc_tax( $item['cost'], $tax_rates, false );
$line_tax = max( 0, array_sum( $line_taxes ) );
$shipping_tax_total += $line_tax;