Change Text on WooCommerce Empty Cart Page ‘Return To Store’ Button

IOC return to store

With the latest release of Woocommerce coming across, it has brought in some cool features along with.

One of the features that have made life easier is changing the button text “Return of Store” when the cart page is Empty. 

Please note : (It will show a “Proceed to Checkout” button if there is an item on the cart. To change the text you can read the article here.)

This provision to change the text on the button helps businesses to give a personal touch to their prospective customers.

The filter in question is woocommerce_return_to_shop_text and the below script can be used to change the text.

add_filter('woocommerce_return_to_shop_text', 'prefix_store_button');
 * Change 'Return to Shop' text on button
function prefix_store_button() {
        $store_button = "Back to Store"; // Change text as required

        return $store_button;

To activate the functionality the above snippet can be added directly to your themes function.php.

But we would recommend against making changes to the functions.php, as you would have to repeat the process all over whenever there is an update to your themes.

Instead, you can use Code Snippets Plugin which is a great tool to manage all of your snippets on a single page. To learn more about Code Snippets and how to use them you can read our article here.

If you need details instructions on how to update and write to the functions.php you can refer to the article here.

Leave a Comment

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