WooCommerce Shipping – Hide checkout fields based on shipping methodAnindo
In many cases, you don’t want to display all the default checkout fields in WooCommerce. For example, many shop owners often prefer not to show the Billing Address field.
Using the below code snippet, one can easily hide any checkout field when a particular shipping method is selected.
Just copy and paste the snippet in Appearance –>Editor –> functions.php and you are done!
As we can see, in the above snippet, on selecting “Free Shipping” as a shipping method in the cart page, Billing address 1 and 2 are hidden from the checkout page. This can be validated from the screenshot shown below: