Skip to content
Docs
Get RestroPress

Filter

rpress_get_discount_min_price

Updated
On this page

Filters the discount minimum cart amount.

Runs in RPRESS_Discount::get_min_price() and filters the value before it is returned to the caller. The filtered value is cast to float before it is returned.

Available since RestroPress 1.0.6.

Parameters#

ParameterTypeDescription
$valuefloatThe discount minimum cart amount.
$discount_idintThe discount ID.

Return value#

float. The minimum cart amount to use.

Example#

function my_rpress_get_discount_min_price( $value, $discount_id ) {
	return (float) $value;
}
add_filter( 'rpress_get_discount_min_price', 'my_rpress_get_discount_min_price', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-discount.php (line 957), in RPRESS_Discount::get_min_price()
Was this page helpful?