Skip to content
Docs
Get RestroPress

Filter

rpress_cart_total

Updated
On this page

Filters the formatted cart total text.

Runs in RPRESS_Cart::total(). The value is the currency-formatted total. It is echoed when $echo is true and returned otherwise.

Parameters#

ParameterTypeDescription
$valuestringCurrency-formatted cart total.

Return value#

string. The formatted total.

Example#

function my_cart_total_label( $total ) {
	return $total . ' ' . esc_html__( 'incl. tax', 'my-textdomain' );
}
add_filter( 'rpress_cart_total', 'my_cart_total_label', 10, 1 );

Notes#

The output is escaped with esc_html() when echoed, so HTML in the value is shown as text.

Source#

Applied in:

  • includes/cart/class-rpress-cart.php (line 1138), in RPRESS_Cart::total()

See also#

Was this page helpful?