Filter
rpress_get_cart_discounted_amount
On this page
Filters the total discount amount of the cart.
Runs in RPRESS_Cart::get_discounted_amount(). The value is the sum of the discount values of the cart's discount codes (or the codes passed in). It feeds into the cart total.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discount_sum | float | Total discount amount. |
Return value#
float. The total discount amount.
Example#
function my_cart_discounted_amount( $discount_sum ) {
return max( 0, $discount_sum );
}
add_filter( 'rpress_get_cart_discounted_amount', 'my_cart_discounted_amount', 10, 1 );
Notes#
Applied at three return points in the method, always with the same argument.
Source#
Applied in:
includes/cart/class-rpress-cart.php(line 1060), inRPRESS_Cart::get_discounted_amount()includes/cart/class-rpress-cart.php(line 1063), inRPRESS_Cart::get_discounted_amount()includes/cart/class-rpress-cart.php(line 1076), inRPRESS_Cart::get_discounted_amount()
See also#
Was this page helpful?
