Advertisement
imnguyen

GACO: change payment gateway condition

Feb 15th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. function authorize_less($available_gateways) {
  2. $maximum = 0;
  3. if ( WC()->cart->total < $maximum ) {
  4. unset( $available_gateways['authorizenet'] );
  5. }
  6. return $available_gateways;
  7. }
  8. add_filter( 'woocommerce_available_payment_gateways', 'authorize_less');
  9.  
  10.  
  11.  
  12.  
  13. function authorize_more($available_gateways) {
  14. $maximum = 0;
  15. if ( WC()->cart->total > $maximum ) {
  16. unset( $available_gateways['cod'] );
  17. }
  18. return $available_gateways;
  19. }
  20. add_filter( 'woocommerce_available_payment_gateways', 'authorize_more', 'woocommerce_cart_calculate_fees' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement