Skip to content
Docs
Get RestroPress

Filter

rpress_multiple_discounts_allowed

Updated
On this page

Filters whether multiple discount codes can be applied to one cart.

Applied in rpress_multiple_discounts_allowed(), which reads the allow_multiple_discounts option (default false). The result is cast to bool. When multiple discounts are not allowed, applying a new code replaces the existing one in rpress_set_cart_discount().

Parameters#

ParameterTypeDescription
$retboolThe value of the allow_multiple_discounts option.

Return value#

bool. True to allow several discount codes in one cart.

Example#

function my_allow_multiple_discounts( $ret ) {
	return true;
}
add_filter( 'rpress_multiple_discounts_allowed', 'my_allow_multiple_discounts' );

Source#

Applied in:

  • includes/discount-functions.php (line 922), in rpress_multiple_discounts_allowed()

See also#

Was this page helpful?