Home / Archive / MemberPress: Override Description for All Payment Methods on Click
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Override Description for All Payment Methods on Click

This code snippet will override the description text from MemberPress settings for all payment methods. When the label for any payment method is clicked on the registration page, the custom description from the code snippet will be displayed.

Note: This will work for the ReadyLaunch registration page to override the description for the Classic registration page; replace this class ".mepr-payment-option-label" with ".mepr_payment_method".

The custom description can be adjusted by modifying the New text you want to display text in this line of code:
var newText = 'New text you want to display';

Code Preview
js
jQuery(document).ready(function($) {
    // Listen for a click event on the payment method label
    $(document).on('click', '.mepr-payment-option-label', function() {
        // Loop through all payment method description elements and update the text
        $('.mepr-payment-method-desc-text').each(function() {
            var $this = $(this);
            var newText = 'New text you want to display'; // Replace with your desired text
            $this.text(newText); // Set the new text for the description
        });
    });
});

Comments

Add a Comment