Flat rate shipping costs should ignore virtual items.

Closes #8506
This commit is contained in:
Mike Jolley 2015-07-07 10:41:56 +01:00
parent e95ad464ae
commit 85dcee63ae
1 changed files with 3 additions and 1 deletions

View File

@ -320,7 +320,9 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
break;
case 'item' :
foreach ( $package['contents'] as $item_id => $values ) {
$cost = $this->calc_percentage_adjustment( $cost, $cost_percent, $cost_operator, $values['line_total'] );
if ( $values['data']->needs_shipping() ) {
$cost = $this->calc_percentage_adjustment( $cost, $cost_percent, $cost_operator, $values['line_total'] );
}
}
break;
case 'order' :