---
title: "Free Shipping Bar: Developer Hooks and Filters Reference"
description: "Developer reference for the WooCommerce free shipping bar: filters, actions, the helper function and examples."
url: "https://wpfactory.com/docs/free-shipping-developer-hooks-filters/"
updated: "2026-09-27"
category: Developers
---

# Free Shipping Bar: Developer Hooks and Filters Reference

This reference lists the PHP hooks, filters, and helper function exposed by the [Free Shipping Bar: Amount Left for Free Shipping for WooCommerce](https://wpfactory.com/item/amount-left-free-shipping-woocommerce/). Names are taken directly from the plugin source (version 2.5.4). Add your snippets to a child theme `functions.php` or a small custom plugin.

### Filters

| Filter | Passed value | Purpose |
| --- | --- | --- |
| `alg_wc_get_left_to_free_shipping` | string `$result`, array `$args` | The final message HTML before it is printed. Modify or wrap the output. |
| `alg_wc_get_left_to_free_shipping_args` | array `$args` | The argument array (content, location, template, and so on) before the message is built. |
| `alg_wc_get_left_to_free_shipping_validation` | bool `$validation`, array `$args` | Return false to hide the message for the current request. This is the hook the Pro category and user-role hiding uses. |
| `alg_wc_left_to_free_shipping_cart_total` | float `$total` | The cart total the plugin uses in its calculation. Adjust to include or exclude custom amounts. |
| `alg_wc_left_to_free_shipping_manual_min_amount` | array `$data`, array `$args` | The resolved manual minimum (`amount`, `is_available`). The WooCommerce Currency Switcher conversion hooks in here. |
| `alg_wc_left_to_free_shipping_manual_min_amount_available_types` | array `$id_array`, array `$args` | The list of matched extra-option keys (role, currency, zone, method, class) for the current cart. |
| `alg_wc_left_to_free_shipping_amount_types` | array `$types` | The extra-option types available for manual amounts (roles, currencies, zones, shipping_methods, shipping_classes). |
| `alg_wc_left_to_free_shipping_ajax_events` | string `$events` | Extra space-separated JavaScript events that trigger an AJAX refresh, added on top of the settings field. |
| `alg_wc_left_to_free_shipping_wide_notice_animation_time` | int `$ms` (default 300) | Animation duration in milliseconds for the site-wide store notice. |

### Actions

| Action | Passed value | Purpose |
| --- | --- | --- |
| `alg_wc_left_to_free_shipping_core_loaded` | object `$core` | Fires once the core class is ready. Useful for attaching your own front-end output. Note: this is also used as a filter internally. |

### Helper function

Output or retrieve the message anywhere in PHP:

```
echo alg_wc_get_left_to_free_shipping( array(
    'content'  => '%amount_left_for_free_shipping% left for free shipping',
    'location' => 'custom',
) );
```

Accepted keys include `content`, `template`, `multiply_by`, `min_free_shipping_amount`, `free_delivery_text`, `min_cart_amount`, and `location`.

### Examples

Hide the message for a specific page:

```
add_filter( 'alg_wc_get_left_to_free_shipping_validation', function( $validation, $args ) {
    if ( is_front_page() ) {
        return false;
    }
    return $validation;
}, 10, 2 );
```

Add a custom refresh event:

```
add_filter( 'alg_wc_left_to_free_shipping_ajax_events', function( $events ) {
    return trim( $events . ' my_custom_event' );
} );
```

### Shortcodes and widget

For the registered shortcodes, the widget, and the message placeholders, see the [Free shipping shortcodes and widget](https://wpfactory.com/docs/amount-left-free-shipping-woocommerce/) and [Free shipping message placeholders](https://wpfactory.com/docs/amount-left-free-shipping-woocommerce/) references.

Need a hand? Our team answers every ticket on the [Amount Left for Free Shipping support forum](https://wpfactory.com/support/item/amount-left-free-shipping-woocommerce/).

Related articles

- [Free Shipping Message Placeholders Reference](https://wpfactory.com/docs/free-shipping-message-placeholders/)
- [Third-Party Plugin Compatibility for the Free Shipping Bar](https://wpfactory.com/docs/free-shipping-third-party-compatibility/)
- [Free Shipping Bar Troubleshooting Checklist](https://wpfactory.com/docs/troubleshooting-checklist/)
- [Free Shipping Bar Breaks After a WordPress or WooCommerce Update](https://wpfactory.com/docs/plugin-breaks-after-update/)
- [Free Shipping Bar Not Showing in the WooCommerce Cart Block or Mini-Cart](https://wpfactory.com/docs/plugin-cart-block-issue/)
