Advertisement
Fany_VanDaal

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

May 23rd, 2019
231
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement