How to Change “Return to Shop” Button text in WooCommerce

How to Change “Return to Shop” Button text in WooCommerce
1043 Views
3.4
(51)

Change “Return to Shop” Button text in WooCommerce a WordPress plugin this is quit easy to change it using gettext filter. If you are not using shop or name it something like back to home or store.

screenshot webbydemo.in 2022.12.15 10 38 43
<?php
 add_filter( 'gettext', 'cxc_change_woocommerce_return_to_shop_text', 20, 3 );

function cxc_change_woocommerce_return_to_shop_text( $translated_text, $text, $domain ) {
	switch ( $translated_text ) {
		case 'Return to shop' :
		$translated_text = __( 'Return to Store', 'cxc-codexcoach' );
		break;
	}
	return $translated_text; 
}
?>

Alternative solutions

<?php
add_filter( 'woocommerce_return_to_shop_text', 'cxc_woocommerce_return_to_shop_text_button' );

function cxc_woocommerce_return_to_shop_text_button() {
	$store_button = "Back to Store"; // Change text as required

	return $store_button;
}
?>

Code goes in function.php file of your active child theme (or active theme).

Video tutorial

How useful was this blog?

Click on a star to rate it!

Average rating 3.4 / 5. Vote count: 51

No votes so far! Be the first to rate this blog.

  • CodexCoach

    - Web Development Expert

    CodexCoach is a skilled tech educator known for easy-to-follow tutorials in coding, digital design, and software development. With practical tips and interactive examples, CodexCoach helps people learn new tech skills and advance their careers.

1 comment

  1. nice article, but how can i add return to store when i have products in cart and want a specific product to be carted 1st as mandatory

Leave a comment

Your email address will not be published. Required fields are marked *