This topic has 6 replies, 2 voices, and was last updated 6 years, 11 months ago ago by Rose Tyler
Hello,
I’m needing to change the link when you click on the cart and it’s empty. Currently it take the person back to shop page but I want to make it take them back to the homepage. Is this possible and if so how?
Hello,
Try to use this code in functions.php of child theme:
/**
* Changes the redirect URL for the Return To Shop button in the cart.
*
* @return string
*/
function wc_empty_cart_redirect_url() {
return 'http://yourdomain.com/your-page/';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );
Regards
Hello,
Tried this but it’s not working unfortunately
Hello,
Oh I see, you need to copy xstore/woocommerce/cart/cart-empty.php file into xstore-child/woocommerce/cart/ folder and make changes according to these screenshots
http://prntscr.com/i4xrzq
http://prntscr.com/i4xs77
Regards
Sorry to sound silly what do you mean copy? I’m no good with all this stuff lol
Hello,
You need to create cart-empty.php file in child theme, that has the same content as this file in the parent theme, and make changes here. Please read more about child theme functionality – https://codex.wordpress.org/Child_Themes
Regards
You must be logged in to reply to this topic.Log in/Sign up