RestroPress

⌘K
  1. Home
  2. Docs
  3. RestroPress
  4. Developer Docs
  5. Filters
  6. rpress_is_discount_active

rpress_is_discount_active

This filter can be used to check if the discount is active or not. The filter accepts two parameters: It returns true or false.

return apply_filters( ‘rpress_is_discount_active’, $return, $this->ID );

The sample below shows an example of how you could modify it:

function rpress_is_discount_active_callback( $return, $id ) {  
    return $return = true; 
}

add_filter( 'rpress_is_discount_active', 'rpress_is_discount_active_callback', 10, 2 );

How can we help?