Skip to content
Docs
Get RestroPress

Filter

rpress_pause_orders_error_message

Updated
On this page

Filters the message shown when an order is blocked because orders are paused.

Runs when a cart or checkout request is refused while the store is paused. The message depends on the situation: either a general 'not taking new orders' message, or, for an ASAP order on a store that allows pre-orders, a prompt to pick a later time. The state array describes the pause.

Parameters#

ParameterTypeDescription
$messagestringError message.
$statearrayPause state with keys paused, until, extra_prep and extra_until.

Return value#

string. Error message shown to the customer.

Example#

function my_pause_error_message( $message, $state ) {
	return $message . ' ' . __( 'Call us on 555-0100 for urgent orders.', 'my-plugin' );
}
add_filter( 'rpress_pause_orders_error_message', 'my_pause_error_message', 10, 2 );

Notes#

Fired from two places (the service-block check and the plain paused message) with the same arguments.

Source#

Applied in:

  • includes/features/pause-orders/loader.php (line 503), in RPRESS_Pause_Orders::service_block_message()
  • includes/features/pause-orders/loader.php (line 533), in RPRESS_Pause_Orders::paused_message()

See also#

Was this page helpful?