Home / Archive / MemberPress: Change VAT “Customer” Type Label Text to “Business (Non VAT Registered)”
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Change VAT “Customer” Type Label Text to “Business (Non VAT Registered)”

This snippet changes the text of a specific VAT customer type label using JavaScript.

Code Preview
php
<?php
function change_vat_customer_type_label() {
    ?>
    <script type="text/javascript">
        document.addEventListener("DOMContentLoaded", function() {
            // Get a reference to the label element
            const label = document.querySelector('label[for="mepr_vat_customer_type-consumer1"]');
            
            // Check if the label exists before attempting to modify it
            if (label) {
                // Change the text content of the label
                label.textContent = 'Business (Non VAT Registered)';
            }
        });
    </script>
    <?php
}
add_action( 'wp_footer', 'change_vat_customer_type_label' );

Comments

Add a Comment