I'm trying to add a default product shipping weight to WooCommerce in my functions.php file but is not working, I'm not sure if I'm using the right snippets or missing parts of the snippet.
Here's that I'm using,
add_filter('woocommerce_product_get_weight', 'woocommerce_product_get_weight_filter');
function woocommerce_product_get_weight_filter($weight) {
$default_weight = 0.1;
if ((!is_numeric($weight)) || ($weight <= 0.001)) {
return $default_weight;
}
return $weight;
}