Skip to content

Instantly share code, notes, and snippets.

@iMazed
Created May 18, 2021 12:22
Show Gist options
  • Save iMazed/edf13cc9a51d950a98c3b41ccacca95b to your computer and use it in GitHub Desktop.
Save iMazed/edf13cc9a51d950a98c3b41ccacca95b to your computer and use it in GitHub Desktop.
Change 'return to shop' URL in WooCommerce
/**
* Changes the redirect URL for the Return To Shop button in the cart.
*
* @return string
*/
function wc_empty_cart_redirect_url() {
return 'http://mywebsite.com/sample-page/';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment