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

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

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.

<?php
  add_filter( 'gettext', 'change_woocommerce_return_to_shop_text', 20, 3 );

  function change_woocommerce_return_to_shop_text( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
      case 'Return to shop' :
        $translated_text = __( 'Return to Store', 'woocommerce' );
        break;
    }
   return $translated_text; 

  }
?>

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

Was this article helpful?
YesNo

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 *