Filter
rpress_get_cart_amount
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#
| Parameter | Type | Description |
|---|---|---|
$amount | float | The calculated cart amount. |
$add_taxes | bool | Whether tax was added to the amount. |
$local_override | bool | The 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), inrpress_get_cart_amount()
See also#
Was this page helpful?
