Created
December 6, 2017 09:40
-
-
Save Luminus/0049d310f4e567e219151aaf1570e5fc to your computer and use it in GitHub Desktop.
Disable specific payment gateways on a specific language version of your WooCommerce site that's running WPML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpml_filter_gateways($gateways){ | |
if(ICL_LANGUAGE_CODE == 'fr') //Checks if the selected language is French. | |
unset($gateways['paypal']); //"remove" paypal | |
return $gateways; //returns the other payment methods. | |
} | |
add_filter('woocommerce_available_payment_gateways','wpml_filter_gateways',1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment