gateway filter frontend

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #9798
    Olly
    Admin & Mod

      since wppizza version 2.11.8.14

      if you wanted to disable a gateway conditionally (lets say no cash on delivery for non logged in users) you could add this to your themes functions.php

      
      add_filter( 'wppizza_filter_gateways_available', 'myprefix_filter_wppizza_gateways' );
      function myprefix_filter_wppizza_gateways($gateways) {
      if(!is_user_logged_in()){
      unset($gateways['COD']);//gateway keys are always uppercase
      }
      return $gateways;
      }
      
    Viewing 1 post (of 1 total)
    • The topic ‘gateway filter frontend’ is closed to new replies.