Change the link of the Continue shopping button in WooCommerce

In WooCommerce, by default, when we add a product to the cart and click on "Continue shopping" it does not return to the page of the product that we have added to the cart.

In other words, that button returns us to the url from which we came.

In this tutorial we are going to change the behavior of that button so that it directs us to the url that we need, for example to the store or home url.

To do this we are going to use a small code that we are going to add to the functions.php file

/**
 * Return the permalink of the shop page for the continue shopping redirect filter
 *
 * @param  string $return_to
 * @return string
 */
function my_woocommerce_continue_shopping_redirect( $return_to ) {
	return 'http://miweb.com/tienda';
}
add_filter( 'woocommerce_continue_shopping_redirect', 'my_woocommerce_continue_shopping_redirect', 20 );

You have to change "http://miweb.com/tienda" to the url to which you want to redirect the button "Keep buying"

Here is the video tutorial:

Subscribe to my channel:  

Short tutorial but it can get you out of more than one hurry 😉

Leave a comment