Hooks and filters reference #
The Min Max Step Quantity Limits Manager for WooCommerce exposes filters and actions (prefix wpfmmsq_) so developers can adjust computed quantities and extend behavior. All hooks were renamed from the older alg_wc_pq_* prefix in v5.3.1; the old names still fire through a deprecation alias but emit _deprecated_hook() notices.
Quantity value filters #
These let you override the min, max, step, default and price unit that the plugin resolves for a product.
| Filter | Filters |
|---|---|
wpfmmsq_get_product_qty_min |
The resolved minimum quantity for a product. |
wpfmmsq_get_product_qty_max |
The resolved maximum quantity. |
wpfmmsq_get_product_qty_step |
The resolved quantity step. |
wpfmmsq_get_product_qty_default |
The resolved default quantity. |
wpfmmsq_cart_total_quantity |
The cart total quantity used for cart-level rules. |
// Force a minimum of 2 for a specific product ID.
add_filter( 'wpfmmsq_get_product_qty_min', function ( $min, $product ) {
if ( $product && 123 === $product->get_id() ) {
return 2;
}
return $min;
}, 10, 2 );
Validation and behavior filters #
| Filter | Controls |
|---|---|
wpfmmsq_check_min_max_validation |
Whether a cart item passes the min/max check. |
wpfmmsq_check_product_step_result |
Whether a quantity satisfies the step rule. |
wpfmmsq_check_exact_qty_validation |
Whether a quantity matches the allowed/disallowed list. |
wpfmmsq_check_user_role |
Whether the plugin applies for the current user role. |
wpfmmsq_disable_plugin_request |
Force the plugin off for the current request. |
wpfmmsq_qty_dropdown_is_disable |
Whether the dropdown is suppressed for the current product. |
wpfmmsq_product_quantity_floatval |
How a raw quantity string is cast to a float. |
Actions #
| Action | Fires |
|---|---|
wpfmmsq_settings_after_save |
After a settings section is saved (passes the current section id). |
wpfmmsq_after_meta_box_settings |
After the plugin’s product meta box fields are rendered. |
Internal Pro-gating filter #
The wpfmmsq_settings filter is used internally to gate Pro-only fields (it removes the disabled attribute in Pro). Avoid repurposing it in custom code.
Deprecated hook names #
Old names such as alg_wc_pq_get_product_qty_min, alg_wc_pq_cart_total_quantity and alg_wc_product_quantity_floatval map to their wpfmmsq_* equivalents. They still work but emit deprecation notices on debug builds; migrate to the new names.
Need a hand? #
Our team answers every ticket on the Quantity Manager support forum.