WPSlash

How to Set a Dynamic Minimum Order Amount

Saturday February 21, 2026

The minimum order amount for delivery is easy to configure in FoodMaster’s settings — but what if you need different minimums for different customers, different times of day, or different order scenarios? The woofood_minimum_amount_delivery_filter filter lets you override the minimum dynamically in code, without changing your global settings.

What Is the woofood_minimum_amount_delivery_filter?

This filter runs every time FoodMaster checks whether the current cart meets the minimum order requirement for delivery. It receives the configured minimum amount (as a float) and lets you return a different value. The modified minimum is then used for validation at checkout and displayed in the mini-cart warning bar.

add_filter( 'woofood_minimum_amount_delivery_filter', 'my_prefix_custom_minimum' );

function my_prefix_custom_minimum( $minimum ) {
    // $minimum is a float (e.g. 15.00)
    // Return the minimum you want to enforce
    return $minimum;
}

Practical Use Cases with Code Examples

Example 1 — Lower Minimum for Logged-In Customers

FoodMaster minimum order amount filter at WooCommerce checkout

Reward registered customers with a lower minimum order threshold compared to guests.

add_filter( 'woofood_minimum_amount_delivery_filter', 'my_prefix_minimum_by_user_status' );

function my_prefix_minimum_by_user_status( $minimum ) {
    if ( is_user_logged_in() ) {
        return 10.00; // €10 for registered customers
    }

    return $minimum; // default for guests
}

Example 2 — Higher Minimum During Lunch Rush

Set a higher minimum order during peak hours to make delivery financially viable when the kitchen is busiest.

add_filter( 'woofood_minimum_amount_delivery_filter', 'my_prefix_minimum_peak_hours' );

function my_prefix_minimum_peak_hours( $minimum ) {
    $now  = new DateTime( 'now', new DateTimeZone( wp_timezone_string() ) );
    $hour = (int) $now->format( 'H' );

    // Lunch (12–14) and dinner (19–22) peak periods
    if ( ( $hour >= 12 && $hour < 14 ) || ( $hour >= 19 && $hour < 22 ) ) {
        return max( $minimum, 20.00 ); // at least €20 during peak
    }

    return $minimum;
}

Example 3 — Different Minimum by User Role

Apply different minimums per role — useful if you serve both regular consumers and wholesale/corporate clients.

add_filter( 'woofood_minimum_amount_delivery_filter', 'my_prefix_minimum_by_role' );

function my_prefix_minimum_by_role( $minimum ) {
    if ( ! is_user_logged_in() ) {
        return $minimum;
    }

    $user = wp_get_current_user();

    if ( in_array( 'wholesale_customer', (array) $user->roles, true ) ) {
        return 50.00; // €50 minimum for wholesale orders
    }

    if ( in_array( 'vip_customer', (array) $user->roles, true ) ) {
        return 8.00; // €8 minimum for VIP customers
    }

    return $minimum;
}

Example 4 — Remove Minimum for a Specific Product Category

If all items in the cart belong to a high-value category, waive the delivery minimum entirely.

add_filter( 'woofood_minimum_amount_delivery_filter', 'my_prefix_minimum_by_category' );

function my_prefix_minimum_by_category( $minimum ) {
    $cart = WC()->cart;

    if ( ! $cart || $cart->is_empty() ) {
        return $minimum;
    }

    $premium_category_slug = 'premium-dishes'; // replace with your slug

    foreach ( $cart->get_cart() as $cart_item ) {
        $product_id = $cart_item['product_id'];
        if ( ! has_term( $premium_category_slug, 'product_cat', $product_id ) ) {
            return $minimum; // at least one item is not premium, apply minimum
        }
    }

    return 0; // all items are premium — no minimum required
}

Customising the Mini-Cart Message

When a customer’s cart is below the minimum, FoodMaster shows a notice in the mini-cart. You can customise this message with the woofood_minimum_amount_reached_message_minicart filter, which receives the current message and the minimum amount as arguments.

add_filter( 'woofood_minimum_amount_reached_message_minicart', 'my_prefix_custom_minimum_message', 10, 2 );

function my_prefix_custom_minimum_message( $message, $minimum ) {
    $formatted = wc_price( $minimum );

    return sprintf(
        'Add <strong>%s</strong> more to unlock delivery for your area.',
        $formatted
    );
}

Use wc_price() to format the amount correctly for your currency and locale — it handles symbols, decimal separators, and right-to-left languages automatically.

Frequently Asked Questions

Does the filter affect pickup orders too?

No. The woofood_minimum_amount_delivery_filter only applies to delivery. Pickup orders use a separate minimum configured in the pickup settings, and there is a corresponding filter for it.

Can I return 0 to completely remove the minimum?

Yes. Returning 0 effectively removes the delivery minimum for the conditions you define, allowing customers to check out with any cart total.

Does this work with multistore?

Yes. The filter runs per checkout regardless of multistore mode. If you need store-specific minimums, you can read the current store ID from the session inside the filter callback.

Wrapping Up

Dynamic minimum order amounts let you run a smarter delivery operation — protecting margins during peak times, rewarding loyal customers, and offering flexibility to different customer segments. A few lines of code in woofood_minimum_amount_delivery_filter can handle all of these scenarios without touching the plugin settings.

Need help implementing a custom scenario? Open a support ticket and the FoodMaster team will assist you.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Articles

FoodMaster (formerly WooFood)

How to Set Up a Catering and Large Group Order System on Your WooCommerce Restaurant Website: Custom Menus, Minimum Order Requirements, Scheduled Delivery Windows, and Tiered Pricing for Events and Corporate Orders (Complete Guide)

Why Your Restaurant Needs a Dedicated Catering Order System Online Catering revenue in the United States reached an estimated $66.5 billion in 2023 according to the Catering Industry Association, and a significant portion of that spend is shifting online. Corporate clients, event planners, and families organizing celebrations increasingly expect to browse menus, customize orders, and […]
April 14, 2026
FoodMaster (formerly WooFood)

How to Set Up Scheduled Pre-Orders and Advance Meal Ordering for Your WooCommerce Restaurant: Let Customers Order Ahead for Pickup, Catering, and Special Events (Complete Guide)

Why Pre-Ordering Matters for Restaurants: The Business Case for Advance Meal Orders Picture this: it’s the Wednesday before Thanksgiving, and your kitchen is buried under a mountain of last-minute turkey dinner orders. Half your staff is scrambling to prep dishes they didn’t know about two hours ago, and three customers are calling to ask if […]
April 12, 2026
FoodMaster (formerly WooFood)

WooCommerce Restaurant Plugin Comparison: FoodMaster vs GloriaFood vs ChowNow vs Square Online vs MenuDrive — Features, Pricing, and the Best Choice for Your Online Ordering System (2024)

Why Choosing the Right Restaurant Ordering Platform Matters A single wrong decision about your online ordering platform can quietly drain your restaurant’s revenue for years. Third-party marketplaces charge commissions ranging from 15% to 30% per order — meaning a restaurant processing $20,000 in monthly <a href="https://www.wpslash.com/how-to-create-and-manage-discount-coupons-and-promotional-offers-for-your-woocommerce-restaurant-percentage-off-bogo-free-delivery-and-seasonal-campaigns-to-boost-online-orders-complete-guide/" title="How to Create and Manage Discount Coupons and Promotional […]
April 11, 2026