Inside this article you will see a tricky concept to change return to shop text in woocommerce. This will be very interesting to see the logical and short code to do it very easily.
WooCommerce is an open-source e-commerce plugin for WordPress. It is designed for small to large-sized online merchants using WordPress.
If you are looking for an article which will give you a concept to change or update Return to Shop Text in woocommerce, you are at the right place to learn. This article contains classified information about to change textual or label value.
Learn More –
- Create a Basic Widget Plugin in WordPress ?
- How to Change Return to Shop Link in Woocommerce
- How to Download with Countdown Timer in WordPress
- How To Print The Executed SQL Query in WordPress
Let’s get started.
Change Return to Shop Text
After completing the WooCommerce setup one of the most common things that you will want to change or update is the ‘Return to Shop’ Text value.
Finding a quick solution for this problem can be difficult for WooCommerce beginners but after reading this article content you will realize that this is a very simple issue that you can solve without the need of a WooCommerce developer.
WooCommerce comes with a filter that allows users to quickly change the text of Return to Shop. Also there are 2 ways to change the text.
You need to add this filter and it’s associated function at the end of functions.php file.
Method #1
This filter is woocommerce specific. When you run this it will change Return to Shop text to Continue Shopping.
Filter
add_filter('woocommerce_return_to_shop_text', 'onlinewebtutor_return_to_shop_text');
Function
function onlinewebtutor_return_to_shop_text(){ return "Continue shopping"; }
Method #2
This filter is wordpress specific. It is very useful in case you want to change existing labels of your website in bulk. Only you need to add a case inside switch with existing label value and it’s updated value.
Filter
add_filter( 'gettext', 'onlinewebtutor_woocommerce_return_to_shop_text', 20, 3 );
Function
function onlinewebtutor_woocommerce_return_to_shop_text( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Return to shop' : $translated_text = __( 'Continue shopping', 'woocommerce' ); break; } return $translated_text; }
Complete Code to Change Text
Here, is the complete code which should be added to functions.php to change the Return to Shop Text.
/** @snippet Change return to shop text @author Online Web Tutor */ add_filter('woocommerce_return_to_shop_text', 'onlinewebtutor_return_to_shop_text'); function onlinewebtutor_return_to_shop_text(){ return "Continue shopping"; }
We hope this article helped you to learn How to Change Return to Shop Text in Woocommerce Tutorial in a very detailed way.
Online Web Tutor invites you to try Skillshike! Learn CakePHP, Laravel, CodeIgniter, Node Js, MySQL, Authentication, RESTful Web Services, etc into a depth level. Master the Coding Skills to Become an Expert in PHP Web Development. So, Search your favourite course and enroll now.
If you liked this article, then please subscribe to our YouTube Channel for PHP & it’s framework, WordPress, Node Js video tutorials. You can also find us on Twitter and Facebook.