Editing the WooCommerce Return To Shop Button

Return to WooCommerce shop button will return to WooCommerce default shopping page on your website. This is the shopping page usually called /shop/. If you want to redirect this page to a different page / link, you can use the code below. It is possible to use any page you want instead of your WooCommerce […]

Editing the WooCommerce Return To Shop Button

Return to WooCommerce shop button will return to WooCommerce default shopping page on your website. This is the shopping page usually called /shop/. If you want to redirect this page to a different page / link, you can use the code below.

It is possible to use any page you want instead of your WooCommerce default shopping page with this code. If you have a catalog-style e-commerce site, this code will be very useful to you. Because users who visit the shopping cart, payment and similar WooCommerce ends see that there are no products in their cart and they need to visit the store page to start shopping. You may want to avoid this and direct your users to a different page.

How to Edit the WooCommerce Return To Store Button?

Add the code below to your theme’s functions.php file. You can visit the View> Theme editor area to access your functions file in the theme folder.

function store_mall_wc_empty_cart_redirect_url() {
        $url = 'https://www.wpservis.com'; // CHANGE THIS URL
        return esc_url( $url );
    }
    add_filter( 'woocommerce_return_to_shop_redirect', 'store_mall_wc_empty_cart_redirect_url' );

If you don’t know how to add code to your theme file, you can use my article called “Editing WordPress functions.php”.

Please send me any questions you have about the implementation of the code in the comments section. Be sure to check out the WooCommerce archive for these and similar articles.

One thought on “Editing the WooCommerce Return To Shop Button”

Leave a Reply

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