Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strangerstudios/fc63e239a37f1dee673b to your computer and use it in GitHub Desktop.
Save strangerstudios/fc63e239a37f1dee673b to your computer and use it in GitHub Desktop.
Hide discount code field on the PMPro checkout page for free levels.
function hide_discount_code_field_for_free_levels($show)
{
global $pmpro_level;
if(function_exists('pmpro_isLevelFree') && pmpro_isLevelFree($pmpro_level))
$show = false;
return $show;
}
add_filter('pmpro_show_discount_code', 'hide_discount_code_field_for_free_levels');
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Hide “Discount Code” field on Membership Checkout for Free or Specified Levels"at Paid Memberships Pro here: https://www.paidmembershipspro.com/hide-discount-code-field-on-membership-checkout-for-free-levels/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment