Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Created May 16, 2017 16:03
Show Gist options
  • Select an option

  • Save SeanChDavis/1747b4cdd8ae58550bbaccd1f0c52417 to your computer and use it in GitHub Desktop.

Select an option

Save SeanChDavis/1747b4cdd8ae58550bbaccd1f0c52417 to your computer and use it in GitHub Desktop.
EDD SL disable renewal discount for specific product
<?php // DO NOT COPY THIS LINE
/*
* Disables renewal discount for specific product
*/
function pw_edd_disable_product_renewal_discount( $renewal_discount, $license_id ) {
$license = edd_software_licensing()->get_license( $license_id );
// replace 40 with relevant ID
if( 40 == $license->download_id ) {
$renewal_discount = 0;
}
return $renewal_discount;
}
add_filter( 'edd_sl_renewal_discount_percentage', 'pw_edd_disable_product_renewal_discount', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment