• Resolved p13patch

    (@p13patch)


    Hi WooCommerce Support,

    I am currently trying to set up a free shipping option for my store where customers will receive free shipping if their order total exceeds $100.

    I’ve followed the usual steps by going to WooCommerce > Settings > Shipping and adding Free Shipping to the relevant shipping zones, but I cannot find the “Free Shipping Requires” dropdown option that should allow me to set a minimum order amount for free shipping. I have also updated the WooCommerce plugin to the latest version, but the option still doesn’t appear.

    Here’s what I need:

    • Free shipping should apply automatically when the cart total is over $100.
    • Any other shipping methods should not be displayed once the cart qualifies for free shipping.

    I’ve tried a few workarounds, including custom code, but I’d prefer to use the built-in features if possible.

    Any advice on how to set this up in the latest version of WooCommerce? Could this feature have been moved or changed?

    Thank you in advance for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Stef

    (@serafinnyc)

    Hello @p13patch we don’t offer any built features like that. You’ll need to use an app like Advanced Free Shipping or a custom hook. Which you mentioned you tried. Can you paste your hook so I can review please?

    Also, make sure you’re clearing cache after you added that hook. Often times your hooks won’t work if you’re stuck in cache.

    Ycan also use the standard cache bypass which is /?nocache=1 by adding this to the end of your url.

    • This reply was modified 2 months ago by Stef.
    Thread Starter p13patch

    (@p13patch)

    This is the code I was working with to hook into the shipping functionality of WooCommerce:

    function hide_free_shipping_if_order_total_less_than_100( $rates, $package ) {
    // Set the minimum order total for free shipping
    $minimum_order_total = 100;

    // Get the cart subtotal (without shipping and taxes)
    $cart_subtotal = WC()->cart->subtotal;

    // Debugging to check cart subtotal
    error_log( 'Cart Subtotal: ' . $cart_subtotal );

    // Check if the cart subtotal is less than the minimum required
    if ( floatval( $cart_subtotal ) < $minimum_order_total ) {
    // Debugging to confirm threshold check
    error_log( 'Removing free shipping as cart total is below ' . $minimum_order_total );

    // Loop through the shipping rates
    foreach ( $rates as $rate_key => $rate ) {
    // Check if the current rate is 'free_shipping'
    if ( 'free_shipping' === $rate->method_id ) {
    // Debugging to confirm rate removal
    error_log( 'Removing free shipping method: ' . $rate_key );

    // Remove the free shipping option
    unset( $rates[ $rate_key ] );
    }
    }
    }

    return $rates;
    }

    add_filter( 'woocommerce_package_rates', 'hide_free_shipping_if_order_total_less_than_100', 10, 2 );

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @p13patch,

    Thank you for reaching out.

    I understand that you’re having trouble setting up a free shipping option for orders over $100, but are having trouble selecting the?“Free Shipping Requires”?dropdown option.

    In that case, I’d recommend deactivating all other active plugins, leaving WooCommerce as the only active plugin. Should the issue with the dropdown persist, I recommend trying a default theme like Storefront to see if this helps.

    Once the drop-down select the?“Free Shipping Requires” is active, you can try the steps detailed in this guide.

    I hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.