I tried to add the following code to the bottom of the functions.php file for my Child Theme and then the site broke. Now I get a 500 Error when I try and access the live site or wp-admin.
add_filter('add_to_cart_redirect', 'themeprefix_add_to_cart_redirect');
function themeprefix_add_to_cart_redirect() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
I tried copying and pasting the default template for the functions.php Child Theme file and that still did not fix the site. I also tried clearing my browser cache.
I am going to restore my site to a previous back up but how do I prevent this from happening again in the future.
Thanks in advance!
