Signature
$max_tip = (float) apply_filters(
'mam_wc_pv_max_tip_amount',
max( 50, 2 * (float) $order->get_total() ),
$order
);
| Parameter | Type | Description |
|---|---|---|
$max_tip |
float |
The cap. Default: the greater of 50 and 2 × order total |
$order |
WC_Order |
The order being reviewed/tipped |
Returns the maximum tip amount (in store currency) accepted from the app.
When it fires
In the order-review tip flow (mam_wc_pv_vendor_reviews::process_tip_charge()), before any money moves. The client-supplied tip_amount must be numeric, non-negative, and not greater than this cap; otherwise the tip is rejected and logged. If the rejected order is on a payment hold (tsl-setting-checkout_place_hold_on_order = yes), the held charge is still captured for the plain order total, so a bad tip value never strands the payment.
Example — flat cap
add_filter( 'mam_wc_pv_max_tip_amount', function ( $max, WC_Order $order ) {
return 25.00; // never accept more than a $25 tip
}, 10, 2 );
Example — percentage cap
add_filter( 'mam_wc_pv_max_tip_amount', function ( $max, WC_Order $order ) {
return round( 0.5 * (float) $order->get_total(), 2 ); // max 50% of the order
}, 10, 2 );
Notes
- The cap exists because the tip amount arrives from the client; this filter is the only knob — there is no admin setting for it.
- Returning
0effectively disables tipping (every positive tip exceeds the cap). - The accepted tip then flows through
mam_wc_vendor_split_tipand the vendor Tip product — see Hooks:mam_wc_vendor_get_tip_productandmam_wc_vendor_split_tip.
Related articles
- Recipe: Commissions, settlement, and payouts
- Hooks:
mam_wc_vendor_get_tip_productandmam_wc_vendor_split_tip
Metadata
| Field | Value |
|---|---|
| Article type | Hook Reference |
| Plugin slug | mam-woocommerce-product-vendors |
| Applies to plugin version | 26.19.1+ |
| Category | Extending MAM Suite |
| Hook type | filter |
| Audience | PHP developer / integrator |
| Last verified | 2026-06-10 |
