Created
May 23, 2014 08:09
-
-
Save Willem-Siebe/c1d70aeef75a3e60ab15 to your computer and use it in GitHub Desktop.
The return to shop button in WooCommerce empty-cart.php goes to the shop archive page. However, if we don't want a shop page and leave this option unset in WooCommerce settings, we need this button to go to our homepage. See http://codex.wordpress.org/Function_Reference/get_home_url. For help on filters see http://dev.themeblvd.com/tutorial/filt…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The return to shop button in WooCommerce empty-cart.php goes to the shop archive page. However, if we don't want a shop page and leave this option unset in WooCommerce settings, we need this button to go to our homepage. See https://gist.github.com/Willem-Siebe/c1d70aeef75a3e60ab15. | |
function wsis_woocommerce_return_to_shop_redirect() { | |
return get_home_url(); | |
} | |
add_filter( 'woocommerce_return_to_shop_redirect', 'wsis_woocommerce_return_to_shop_redirect' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment