Hook to disable fees if local pickup
-
I noticed that it is not possible to disable fee if the customer chooses local pickup as the shipping method.
I would like to get around this by creating a hook but I need help to do that.I have created this code into functions.php of my template:
do_action( 'woocommerce_shipping_method_chosen', 'if_local_pickup_disable_fee', 10, 1 ); function if_local_pickup_disable_fee( $chosen_method ) { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ($chosen_shipping == 'local_pickup') { // TODO } }
Can you help me please?
Thanks in advance and congratulation for your beautiful plugin.
Marco
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Hook to disable fees if local pickup’ is closed to new replies.