Filtering payment gateways
-
Hi,
I am trying to filter payment gateways depending on choosen shipping method. I have tried this filter, but it does not work:
add_filter( 'woocommerce_available_payment_gateways', 'hide_unrelated_gateways'); function hide_unrelated_gateways ($available_gateways) { if( isset( $available_methods['local_delivery']) OR isset( $available_methods['international_delivery'] ) ) { unset($available_gateways['cheque'] ); } if( isset( $available_methods['local_pickup'])) { unset($available_gateways['cod'] ); } return $available_gateways; }
I am new to WordPress and PHP, so can anybody help me, please?
Many thanks from Alex
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Filtering payment gateways’ is closed to new replies.