Skip to content
Snippets Groups Projects
Commit f3b0bfe7 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Fix warning message when product variation has no weight

parent e633bc97
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment