Filter
rpress_discount_is_not_global
On this page
Filters whether a discount is restricted to specific menu items.
Runs in RPRESS_Discount::get_is_not_global(). When true, the discount applies only to the required menu items rather than to the whole cart. The filtered value is cast to bool before it is returned.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$is_not_global | bool | Whether the discount is not applied globally. |
$discount_id | int | The discount ID. |
Return value#
bool. Whether the discount is not global.
Example#
function my_discount_is_not_global( $is_not_global, $discount_id ) {
return $is_not_global;
}
add_filter( 'rpress_discount_is_not_global', 'my_discount_is_not_global', 10, 2 );
Source#
Applied in:
includes/class-rpress-discount.php(line 993), inRPRESS_Discount::get_is_not_global()
Was this page helpful?
