Advertisement
Fany_VanDaal

Umožnění platby na dobírku jen "ověřeným" zákazníkům

May 23rd, 2019
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. // povolení dobírky jen pro uživatele s rolí member
  2. add_filter( 'woocommerce_available_payment_gateways', 'vandaal_cod_enable_manager' );
  3.  
  4. function vandaal_cod_enable_manager( $available_gateways ) {
  5. global $woocommerce;
  6. if ( isset( $available_gateways['cod'] ) && !current_user_can('member') ) {
  7. unset( $available_gateways['cod'] );
  8. }
  9. return $available_gateways;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement