Skip to content
Docs
Get RestroPress

Filter

rpress_get_cart_discountable_subtotal

Updated
On this page

Filters the portion of the cart subtotal that discounts can apply to.

Runs in RPRESS_Cart::get_discountable_subtotal() after the subtotal of items not excluded by discount rules has been computed.

Parameters#

ParameterTypeDescription
$subtotalfloatSubtotal of the discountable items.

Return value#

float. The discountable subtotal.

Example#

function my_cart_discountable_subtotal( $subtotal ) {
	return $subtotal;
}
add_filter( 'rpress_get_cart_discountable_subtotal', 'my_cart_discountable_subtotal', 10, 1 );

Source#

Applied in:

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

See also#

Was this page helpful?