There is a public function called “save_payment_method_checkbox()” in WooCommerce that prints “Save to account” at WooCommerce checkout. Here is the function:

/**
 * Outputs a checkbox for saving a new payment method to the database.
 * @since 2.6.0
 */
public function save_payment_method_checkbox() {
    printf(
        '<p class="form-row woocommerce-SavedPaymentMethods-saveNew">
            <input id="wc-%1$s-new-payment-method" name="wc-%1$s-new-payment-method" type="checkbox" value="true" style="width:auto;" />
            <label for="wc-%1$s-new-payment-method" style="display:inline;">%2$s</label>
        </p>',
            esc_attr( $this->id ),
            esc_html__( 'Save to account', 'woocommerce' )
        );
    }
}

I have edited the code (not ideal as it is core) so it displays “Save to my xxx account”. Does anybody know if there is a filter or hook available to change this text instead of changing core? I have tried using jQuery to rename the string that does show for a brief 2 seconds but when the page has fully loaded it is overwritten:

jQuery("label[for='wc-gocardless-new-payment-method']").each(function() {
var text = jQuery(this).text();
text = text.replace("Save to Account", "Save to my xxx Account");
    jQuery(this).text(text);
});

Thanks

Read more here: Change wording, "Save to account" at WooCommerce checkout


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: