Home Web Development How to change the “Proceed to PayPal” button text on the WooCommerce checkout page

How to change the “Proceed to PayPal” button text on the WooCommerce checkout page

by Meostar

One of my client ask me to change the default PayPal button text “Proceed to PayPal”

When a customer gets to checkout, the final tab for ‘Review and Payment’ has a button at the bottom right that says ‘Proceed to PayPal’.

Can you change the text ‘Proceed to PayPal’ to say ‘Proceed to Payment’.

 

So, i found the way how we can change it and going to share with you.

Code Snippet:Add the following PHP code to your child theme functions.php file

add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Proceed to PayPal' :
$translated_text = __( 'YOUR NEW BUTTON TEXT', 'woocommerce' );
break;
}
return $translated_text;
}

Here is the result we required

Related Articles

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.