Filter
rpress_get_cart_total
On this page
Filters the cart total.
Runs in RPRESS_Cart::get_total() after subtotal, discounts, tax and fees have been combined and clamped at zero. The method then rounds the filtered value to two decimals.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$total | float | Cart total. |
Return value#
float. The cart total.
Example#
function my_cart_total( $total ) {
return max( 0, $total );
}
add_filter( 'rpress_get_cart_total', 'my_cart_total', 10, 1 );
Notes#
The returned value is stored as the cart total and then rounded to two decimals.
Source#
Applied in:
includes/cart/class-rpress-cart.php(line 1125), inRPRESS_Cart::get_total()
See also#
Was this page helpful?
