Skip to content
Docs
Get RestroPress

Filter

rpress_get_cart_amount

Updated
On this page

Filters the cart amount returned by the deprecated rpress_get_cart_amount().

Applied at the end of the deprecated rpress_get_cart_amount(). The amount starts from the cart subtotal, subtracts applied discounts, optionally adds tax and is never negative. New code should read totals from rpress_get_cart_subtotal() or rpress_get_cart_total().

Parameters#

ParameterTypeDescription
$amountfloatThe calculated cart amount.
$add_taxesboolWhether tax was added to the amount.
$local_overrideboolThe local tax override argument passed to the function.

Return value#

float. The cart amount.

Example#

function my_cart_amount( $amount, $add_taxes, $local_override ) {
	return max( 0, $amount );
}
add_filter( 'rpress_get_cart_amount', 'my_cart_amount', 10, 3 );

Notes#

Deprecated since 1.9. Use rpress_get_cart_subtotal() or rpress_get_cart_total() instead.

Source#

Applied in:

  • includes/deprecated-functions.php (line 193), in rpress_get_cart_amount()

See also#

Was this page helpful?