Last active
December 1, 2017 09:27
-
-
Save biuroreklama/4acc95c9ad3ffb47980ca8dba5a32f80 to your computer and use it in GitHub Desktop.
Dla sposobu wysyłki ukrywanie sposobu płatności - (przez value: flexible_s... i bacs - dotyczy płatności przelewem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function my_custom_available_payment_gateways( $gateways ) { | |
| $chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods' ); | |
| // When 'local delivery' has been chosen as shipping rate | |
| if ( in_array( 'flexible_shipping_10_2', $chosen_shipping_rates ) ) : | |
| // Remove bank transfer payment gateway | |
| unset( $gateways['bacs'] ); | |
| endif; | |
| return $gateways; | |
| } | |
| add_filter( 'woocommerce_available_payment_gateways', 'my_custom_available_payment_gateways' ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment