WooCommerce: Hide Other shipping methods if free shipping is available

In case you need to hide other shipping methods if you offer free shipping through the default WooCommerce functionality you may need to hide the rest shipping methods if the order is eligible for free shipping.

Just add the code below to a site-specific plugin or to the functions.php file of your theme.