# Free Shipping Progress Notice

> Shows "Add 12.00 more to get free shipping" on the cart and checkout pages, or a success message once the threshold is reached.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, shipping, free-shipping, cart
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-free-shipping-progress/

## Code

```php
$wpide_free_shipping_notice = function () {
    $threshold = 75;

    if ( ! function_exists( 'WC' ) || ! WC()->cart || WC()->cart->is_empty() ) {
        return;
    }

    $subtotal = (float) WC()->cart->get_displayed_subtotal();

    if ( $subtotal < $threshold ) {
        wc_print_notice( sprintf( 'Add %s more to your cart to get free shipping.', wc_price( $threshold - $subtotal ) ), 'notice' );
    } else {
        wc_print_notice( 'Your order qualifies for free shipping.', 'success' );
    }
};

add_action( 'woocommerce_before_cart', $wpide_free_shipping_notice );
add_action( 'woocommerce_before_checkout_form', $wpide_free_shipping_notice, 5 );
```

## Notes

Set $threshold to the minimum amount configured in your Free Shipping method.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Free Shipping Progress Notice" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
