Last active
August 29, 2015 14:22
-
-
Save JoelEadeDesign/08d4fe717dcf52c96489 to your computer and use it in GitHub Desktop.
WooCommerce Remove COD for User Role of Stockist
This file contains hidden or 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
/* REMOVE COD FOR USER ROLE STOCKIST */ | |
add_filter( 'woocommerce_available_payment_gateways', 'sow_checkout_restrictions', 10, 1 ); | |
function sow_checkout_restrictions( $available_gateways ) { | |
global $woocommerce; | |
if (!empty(current_user_can('stockist') )) { | |
unset( $available_gateways['cod'] ); | |
} | |
return $available_gateways; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment