Created
November 5, 2017 03:26
-
-
Save clintN/dc7a8425cbc4a911ebd6e9575dff2f36 to your computer and use it in GitHub Desktop.
if Local Pick-up condition
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
| /** | |
| * Do something if local pickup | |
| */ | |
| add_action( 'woocommerce_after_checkout_form', 'bbloomer_disable_shipping_local_pickup' ); | |
| function bbloomer_disable_shipping_local_pickup( $available_gateways ) { | |
| global $woocommerce; | |
| $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); | |
| $chosen_shipping_no_ajax = $chosen_methods[0]; | |
| if ( 0 === strpos( $chosen_shipping_no_ajax, 'local_pickup' ) ) { | |
| echo '<h1>Hello World</h1>'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment