HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux bsx-1-dev 6.8.0-101-generic #101-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 9 10:15:05 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/memberpress/js/admin_coupons.js
(function($) {
  $(document).ready(function() {
    //Date expiration
    if($('.should-expire').is(":checked")) {
      $('.mepr-coupon-expires').show();
    } else {
      $('.mepr-coupon-expires').hide();
    }
    $('.should-expire').click(function() {
      $('.mepr-coupon-expires').slideToggle('fast');
    });

    //Validate before allowing post to be saved
    $('#publish').click(function() {
      if(!$('select.mepr-coupon-products-select').val()) {
        alert(MeprCoupon.mepr_no_products_message); //Alerts the user that they must create memberships before they can save coupons
        return false;
      }
    });

    //trial period
    if($('#_mepr_coupons_trial').is(":checked")) {
      $('.mepr-coupons-trial-hidden').show();
    } else {
      $('.mepr-coupons-trial-hidden').hide();
    }
    $('#_mepr_coupons_trial').click(function() {
      $('.mepr-coupons-trial-hidden').slideToggle('fast');
    });
  });
})(jQuery);