Skip to content
Docs
Get RestroPress

Filter

rpress_get_cart_subtotal

Updated
On this page

Filters the cart subtotal.

Runs in RPRESS_Cart::get_subtotal(). The value is the sum of the item subtotals before discounts, fees and tax.

Parameters#

ParameterTypeDescription
$subtotalfloatCart subtotal.

Return value#

float. The cart subtotal.

Example#

function my_cart_subtotal( $subtotal ) {
	return round( $subtotal, 2 );
}
add_filter( 'rpress_get_cart_subtotal', 'my_cart_subtotal', 10, 1 );

Source#

Applied in:

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

See also#

Was this page helpful?