Home » WooCommerce: Edit “Continue Shopping” Link Redirect

WooCommerce: Edit “Continue Shopping” Link Redirect

by Tutor Aspire

“Continue Shopping” appears on the Cart page when an item is added to Cart and you have “Redirect to the cart page after successful addition” enabled via the WooCommerce settings.

By default, “Continue Shopping” button redirects to the previously visited page – sometimes this makes no sense and you might want to send them back to the main shop page instead (or a custom page).

Here’s a quick snippet to do just that. Enjoy!

The “Continue Shopping” link @ WooCommerce Cart

PHP Snippet: Change “Continue Shopping” Redirect

/**
 * @snippet       Continue Shopping Link - WooCommerce Cart
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @compatible    WooCommerce 3.6.2
 * @donate $9     https://www.tutoraspire.com
 */

add_filter( 'woocommerce_continue_shopping_redirect', 'tutoraspire_change_continue_shopping' );

function tutoraspire_change_continue_shopping() {
return wc_get_page_permalink( 'shop' );
}

You may also like