Set custom total weight in WooCommerce
-
The flexible shipping plugin calculates total weight by adding per product weight. Here I want to calculate the total weight for example – (weight1 + weight2)/2 and assign this weight to the Flexible shipping Plugin so that the plugin applies conditions for this weight.
I am almost near to the solution. But I don’t know how to assign custom total weight in the plugin.
add_filter('woocommerce_cart_contents_weight', 'custom_cart_contents_weight', 10, 1); function custom_cart_contents_weight($weight) { global $total_weight; $weight = $total_weight; return $weight; }
With this code, I can change the total weight for WooCommerce but your plugin doesn’t apply a condition for my calculated weight. How to solve it?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Set custom total weight in WooCommerce’ is closed to new replies.