How to set a custom URL for the Continue Shopping button in the Cart

When you set WooCommerce to automatically redirect to the Cart when a customer adds a product to their cart, a Continue Shopping button appears on the page.

Continue Shopping Button

By default, the Continue Shopping button redirects the customer back to the product page that had just been added to the cart. If you’d like the change that redirect link, add the following code snippet to your child theme’s functions.php file:

/**
 * Redirect the Continue Shopping URL from the default (most recent product) to
 * a custom URL.
 * Place this code snippet in your theme's functions.php file.
 */
function custom_continue_shopping_redirect_url ( $url ) {
	$url = "http://www.woothemes.com"; // Add your link here
	return $url;
}
add_filter('woocommerce_continue_shopping_redirect', 'custom_continue_shopping_redirect_url');

I hope that this helps!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s