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:
parent
94a9c649ba
commit
29692a22c5
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue