diff --git a/includes/rules_shipping_framework_woocommerce.php b/includes/rules_shipping_framework_woocommerce.php index fc01c1a25db5cd3a0c788d3ddfab99b2525aa975..f0c75f20e6be7d4305665b2fd00756b329215c74 100644 --- a/includes/rules_shipping_framework_woocommerce.php +++ b/includes/rules_shipping_framework_woocommerce.php @@ -185,9 +185,11 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { ); foreach ($products as $product) { $w = $product['data']->get_weight(); - $dimensions['maxweight'] = max ($dimensions['maxweight'], $w); - $dimensions['minweight'] = min ($dimensions['minweight'], $w); - $dimensions['weight'] += $w * $product['quantity']; + if (is_numeric($w)) { + $dimensions['maxweight'] = max ($dimensions['maxweight'], $w); + $dimensions['minweight'] = min ($dimensions['minweight'], $w); + $dimensions['weight'] += $w * $product['quantity']; + } } return $dimensions; }