Order Minimum/Maximum Amount Limits for WooCommerce exposes filters and actions so you can adjust limits, cart totals, messages, and behavior in code without editing plugin files. Every hook uses the alg_wc_oma_ prefix. This reference lists the hooks that exist in the current version, plus the option and meta naming scheme and the three real shortcodes.
Option and meta naming #
Global settings are stored as options named alg_wc_oma_{min|max}_{type}, for example alg_wc_oma_min_sum or alg_wc_oma_max_qty. Per-user and per-product limits are stored as meta keyed _alg_wc_oma_{min|max}_{type} on the user or product. The amount types are sum, qty, weight, volume, length, width, height, area, product, product_cat, and product_tag.
Value filters #
These fire on a value the plugin is about to use, so whatever your callback returns wins.
| Filter | Filtered value |
|---|---|
alg_wc_oma_get_min_max_amount_data |
The resolved min/max amount data for a check. |
alg_wc_oma_before_get_min_max_amount_data / alg_wc_oma_after_get_min_max_amount_data |
The amount data before and after resolution. |
alg_wc_oma_get_min_max_amount_per_product / alg_wc_oma_after_get_min_max_amount_per_product |
The per-product limit for a scope check. |
alg_wc_oma_amount_cart_total |
The computed cart total for a given amount type. |
alg_wc_oma_get_cart_value |
A single cart item’s contribution to the total. |
alg_wc_oma_get_cart_total_do_count_product |
Whether a cart item is counted toward the total. |
alg_wc_oma_check_order_min_max_amount |
The pass/fail result of a limit check. |
alg_wc_oma_block_checkout |
Whether checkout is blocked. |
alg_wc_oma_currency_rate |
The exchange rate used for per-currency limits (passed 0 if none resolved). |
Override the minimum sum for a specific case #
add_filter( 'alg_wc_oma_get_min_max_amount_data', function ( $data ) {
// $data typically holds 'amount', 'min_or_max', 'type'.
if ( isset( $data['min_or_max'], $data['type'] ) && 'min' === $data['min_or_max'] && 'sum' === $data['type'] ) {
$data['amount'] = 75;
}
return $data;
} );
Amount type and formatting filters #
| Filter | Controls |
|---|---|
alg_wc_oma_amount_types |
The list of available amount types (add your own here). |
alg_wc_oma_amount_title |
The human title of an amount type. |
alg_wc_oma_amount_unit |
The unit shown for an amount type. |
alg_wc_oma_amount_format |
The formatted output of an amount value. |
alg_wc_oma_amount_input_type |
Whether an amount input renders as a number or text field. |
Add a custom amount type #
add_filter( 'alg_wc_oma_amount_types', function ( $types ) {
$types['calories'] = __( 'Calories', 'my-plugin' );
return $types;
} );
Message, notice and scope filters #
alg_wc_oma_placeholders– the placeholder => value map used when rendering a message.alg_wc_oma_get_default_message– the default message text for a limit.alg_wc_oma_get_notices/alg_wc_oma_after_get_notices– the notices collected for the current request.alg_wc_oma_is_source_message,alg_wc_oma_enabled_message_sources,alg_wc_oma_enabled_scopes– control which message sources (shipping, gateway) and scopes (product, category, tag) are active.alg_wc_oma_do_add_shipping_script– whether the shipping refresh script is enqueued.
Settings and Pro gating filters #
alg_wc_oma_settings is how the plugin decides whether a Pro-only field is disabled: in the free version it returns array( 'disabled' => 'disabled' ); in Pro it returns ''. alg_wc_oma_settings_per_item assembles the dynamic per-item (per role, per gateway, and so on) settings. Both are internal and not intended for store customization.
Actions #
| Action | Fires when |
|---|---|
alg_wc_oma_core_loaded |
The plugin core has finished loading. |
alg_wc_oma_check_notices_on_block_cart_change |
Cart block notices are re-checked after a cart change. |
alg_wc_oma_before_settings_user_roles |
Before the User Roles settings render (used by the deprecated-data migration). |
Shortcodes #
[alg_wc_oma_translate](Free) – conditional text by WPML/Polylang language. Attributes:lang,not_lang.[alg_wc_oma_amount_msg](Pro) – prints its content when a limit is unmet. Attributes:min_or_max,type,scope,product_id,on_empty. Deprecated alias:[alg_wc_order_min_max_amount].[alg_wc_oma_amount](Pro) – returns a numeric value for an amount field. Attributes:value,customer_type,user_bought_term_id,check_parent_bought_term_id.
For full shortcode usage and placeholders, see the shortcodes and placeholders reference.
Need help? #
If you are extending Order Min/Max Amount and a hook does not behave as expected, contact us on the support forum with the hook name and a short code sample.
