Woo-Commerce redirect using filters


/**
* Redirect to a specific page when clicking on Continue Shopping in the cart
*
* @return void
*/
function wc_custom_redirect_continue_shopping() {
$url = site_url().’/product-category/accessories/’;
return $url;
}
add_filter( ‘woocommerce_continue_shopping_redirect’, ‘wc_custom_redirect_continue_shopping’ );

/**
* Changes the redirect URL for the Return To Shop button in the cart.
*
* @return string
*/
function wc_empty_cart_redirect_url() {
$url = site_url().’/product-category/accessories/’;
return $url;
}
add_filter( ‘woocommerce_return_to_shop_redirect’, ‘wc_empty_cart_redirect_url’ );

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