Merge pull request #8998 from toddlahman/master
Fix for Invalid argument supplied for foreach
This commit is contained in:
commit
591725874a
|
@ -239,11 +239,13 @@ class WC_Tax {
|
|||
$rates = self::find_rates( $args );
|
||||
$shipping_rates = array();
|
||||
|
||||
if ( is_array( $rates ) ) {
|
||||
foreach ( $rates as $key => $rate ) {
|
||||
if ( 'yes' === $rate['shipping'] ) {
|
||||
$shipping_rates[ $key ] = $rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $shipping_rates;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue