Created
May 30, 2018 02:10
-
-
Save cklosowski/15badf629336dbf19c87c8c1545e50d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Easy Digital Downloads - Grandfather Renewal Rate | |
* Description: Allows a custom renewal discount to be set for customers who purchased before a custom date | |
* Author: Pippin Williamson | |
* Author URI: https://easydigitaldownloads.com | |
* Version: 1.0 | |
*/ | |
/* | |
* Sets renewal discount to 40% for any customer that purchased before April 18, 2016 | |
*/ | |
function pw_edd_grandfather_renewal_discount( $renewal_discount, $license_id ) { | |
$license = edd_software_licensing()->get_license( $license_id ); | |
if( strtotime( $license->date_created ) < strtotime( 'April 18, 2016' ) ) { | |
$renewal_discount = 40; | |
} | |
return $renewal_discount; | |
} | |
add_filter( 'edd_sl_renewal_discount_percentage', 'pw_edd_grandfather_renewal_discount', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment