Home / Archive / MemberPress: Auto Expand Coupon Field
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Auto Expand Coupon Field

By default, the coupon field is hidden on the MemberPress registration forms. Instead, users will see the “Have a discount code” text link. When the link is clicked, the input field will show, allowing users to input their coupon code.

This code snippet will automatically show the coupon field on every MemberPress registration form, removing the need for the additional click on the “Have a discount code” link.

Code Preview
php
<?php
function auto_click_have_coupon_link() {
  ?>
    <script type="text/javascript">
      (function($) {
        $(document).ready(function() {
          $('.mepr-signup-form .have-coupon-link').trigger('click');
        });
      })(jQuery);
    </script>
  <?php
}
add_action( 'wp_footer', 'auto_click_have_coupon_link' );

Comments

Add a Comment