Open WordPress admin panel, go to Appearance > Theme Editor
Open functions.php theme file
Add the following code at the bottom of function.php file
Save the changes and check your website. The custom text in add to cart button should show up now.
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
How to change woocommerce checkout 'Ship to a Different Address' section title
functionshipchange($translated_text, $text, $domain) {
switch ( $translated_text ) {
case'Ship to a different address?' :
$translated_text = __( 'Partial Pay', 'woocommerce' );
break;
}
return$translated_text;
}
add_filter('gettext', 'shipchange', 20, 3);