Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey,

    I had to do this has well so i use this code :

    add_action( 'woocommerce_checkout_process', 'suppress_check_local_pickuptime', 9 );
    add_action( 'woocommerce_checkout_update_order_meta', 'suppress_check_local_pickuptime', 9 );
    
    function suppress_check_local_pickuptime(){
      $shipping_methods = $_REQUEST['shipping_method'];
      $has_local_pickup = false;
    
      foreach($shipping_methods as $shipping_method){
        if(strpos($shipping_method, 'local_pickup') !== false){
          $has_local_pickup = true;
        }
      }
      if(!$has_local_pickup){
        $Local_Pickup_Time = Local_Pickup_Time::get_instance();
        remove_action('woocommerce_checkout_process',array($Local_Pickup_Time, 'field_process'));
        remove_action( 'woocommerce_checkout_update_order_meta', array( $Local_Pickup_Time, 'update_order_meta' ) );
      }
    }

    It is in a custom plugin for me but you can paste it in functions.php

    Plugin Author Tim Nolte

    (@tnolte)

    @graphistemdm & @leroysabrina FYI, the upcoming 1.4.0 release should have this resolved through some new plugin settings. There is some new code that is similar to @leroysabrina has provided.

    Plugin Author Tim Nolte

    (@tnolte)

    @graphistemdm @leroysabrina a new 1.4.0 version was just released that provides this feature built-in now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable the pickup time for other shipping methods’ is closed to new replies.