Skip to content
Docs
Get RestroPress

Filter

rpress_checkout_ux_minimum_order

Updated
On this page

Filters the minimum-order hint state shown at checkout and in the cart.

Built from the minimum order settings for the delivery and pickup services. The array has 'enabled', 'service', 'minimum', 'subtotal', 'shortfall', 'below', 'minimum_formatted', 'shortfall_formatted', 'message' and 'detail'. Changing it changes the hint only; the order is still validated against the minimum by the order validation code.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$statearrayMinimum-order state.
$servicestringService slug.
$subtotalfloatCart subtotal used for the comparison.

Return value#

array. Minimum-order state.

Example#

add_filter( 'rpress_checkout_ux_minimum_order', 'my_minimum_order_state', 10, 3 );
function my_minimum_order_state( $state, $service, $subtotal ) {
	if ( $state['below'] ) {
		$state['message'] = sprintf( __( 'Spend %s more to order', 'my-plugin' ), $state['shortfall_formatted'] );
	}
	return $state;
}

Notes#

The store card in the mobile ordering layer calls the same function with a subtotal of 0 to read the minimum, so this filter also runs there.

Source#

Applied in:

  • includes/features/checkout-ux/functions.php (line 122), in rpress_checkout_ux_minimum_order()
Was this page helpful?