Created
June 9, 2015 18:48
-
-
Save maxrice/366196bce310866499d3 to your computer and use it in GitHub Desktop.
WooCommerce Local Pickup Plus - Remove pickup location action
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
function wc_local_pickup_plus_remove_pickup_location() { | |
$methods = WC()->shipping->load_shipping_methods(); | |
if ( isset( $methods['local_pickup_plus'] ) ) { | |
remove_action( 'woocommerce_after_template_part', array( $methods['local_pickup_plus'], 'review_order_shipping_pickup_location' ), 10, 4 ); | |
} | |
} | |
add_action( 'wc_shipping_local_pickup_plus_init', 'wc_local_pickup_plus_remove_pickup_location' ); |
Any progress on this? I am looking at using local pickup plus and need to do something similar. I need to unset certain payment gateways based on which pickup location is selected. I'd be very grateful if you could post your final solution.
I created a gist that accomplished the functionality that I was looking for. Hope this helps someone else.
https://gist.github.com/artisanpixel/70eb6ad21d105a12741e98f5a4088cbf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to use this to remove a specific location when an specific item(s) is in the cart. I set up a basic if-then statement that triggers if "Local Pick Up Plus" is an available, and any of these product ID's are present in the cart, remove this location. I am getting hung up on how to specify which location I want to remove. Any ideas? I would be eternally grateful for any hints.