How to remove cash on delivery payment in woocommerce to leave only paypal?
-
How to remove cash on delivery payment method in woocommerce to leave only paypal payment option on a certain country only .
I searched the internet a lot, and i found this code that i have to put in my child theme functions.php:function wpml_filter_gateways($gateways){ if(ICL_LANGUAGE_CODE == 'it') //Checks if the selected language is italian. unset($gateways['cod']); //"remove" Local delivery return $gateways; //returns the other payment methods. } add_filter('woocommerce_available_payment_gateways','wpml_filter_gateways',1);
it works, but i need to use it for 2 countries, not only 1. I need to make only paypal payments to England and to Italia (english language version of the website, and Italian version of the website) .
Can you suggest any way to transform this working code above to work with 2 countries, not only with one?
i did try several things , but i couldnt make it work for 2 countries :(.Please help me figure this out.
Thanks really really much, guys ??
- The topic ‘How to remove cash on delivery payment in woocommerce to leave only paypal?’ is closed to new replies.