Skip to content
Docs
Get RestroPress

Action

rpress_cart_empty

Updated
On this page

Fires when the checkout page is shown with an empty cart.

Runs in rpress_checkout_form() when the cart has no items and no fees. It is followed by an "Add Food Items" link. Use it to print a message or a link for visitors with an empty cart.

Available since RestroPress 1.0.

Example#

function my_cart_empty_message() {
	echo '<p class="my-empty-cart">' . esc_html__( 'Your cart is empty.', 'my-textdomain' ) . '</p>';
}
add_action( 'rpress_cart_empty', 'my_cart_empty_message', 10, 0 );

Source#

Fired from:

  • includes/checkout/template.php (line 60), in rpress_checkout_form()

See also#

Was this page helpful?