• Resolved YorkshireDave

    (@yorkshiredave)


    We have two shipping choices. ‘Paid for’ UNDER a min ord value, & ‘free shipping’ OVER min order value.

    The function works fine, however both are still displayed at checkout even when its free delivery!

    How do I stop that showing pls?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You’ll need a code snippet something like this:

    // limit available shipping rates
    add_filter( 'woocommerce_package_rates', 'custom_limit_shipping_rates', 100 );
    function custom_limit_shipping_rates( $rates ) {
      $new_rates = array();
      // if "Free shipping" is available, other options should not be returned
      foreach( $rates as $rate ) {
        if( 'Free shipping' == $rate->label ) {
          $new_rates[ $rate->id ] = $rate;
          return $new_rates;
        }
      }
      return $rates;
    }

    Note that you need to put your exact free shipping label in place of “Free shipping”

    Some PHP skills may be needed to get it working for your site.

    Thread Starter YorkshireDave

    (@yorkshiredave)

    worked perfectly. thankyou

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove unneeded shipping choice’ is closed to new replies.