Excellent solution.
And would it be possible to set the filter for a certain shipping class?
Is there a way to apply his filter for the order subtotal?
For example, if the cart subtotal is less that 50, the “COD” option shall be hidden.
Do you have any idea on how to achieve that?