Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. function my_edd_grandfather_renewal_discount( $renewal_discount, $license_id ) {
  2. if ( ! $license_id ) {
  3. return $renewal_discount;
  4. }
  5. $license = edd_software_licensing()->get_license( $license_id );
  6. if ( ! is_object( $license ) ) {
  7. return $renewal_discount;
  8. }
  9. if( ! empty( $license->date_created ) && strtotime( $license->date_created ) < strtotime( 'April 1, 2018' ) ) {
  10. if ( $license->is_expired() ) {
  11. $renewal_discount = 20;
  12. } else {
  13. $renewal_discount = 30;
  14. }
  15. }
  16. return $renewal_discount;
  17. }
  18. add_filter( 'edd_sl_renewal_discount_percentage', 'my_edd_grandfather_renewal_discount', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement