Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WooCommerce - Filter payment gateways
- add_filter( 'woocommerce_available_payment_gateways', 'custom_available_payment_gateways' );
- function custom_available_payment_gateways( $gateways ) {
- $current_user_id = get_current_user_id();
- $bad_lad_id = 1; // user id for the customer who can't have COD
- if ( $bad_lad_id == $current_user_id ) {
- unset( $gateways['cod'] );
- }
- return $gateways;
- }
Add Comment
Please, Sign In to add comment