Woocommerce Empty Cart makes redirect Loop error
-
Hallo, I got a problem with “This webpage has a redirect loop” when i try to remove the very last item in the Woo-Cart by the (x) on my Chechout-page. If more than 1 item in the Cart i can remove all, but not the last item. (Like empty the Cart).
WC Version: 2.1.12
I use Woo Force SSL on check-out.I’ve tried to redirect the Cart to Frontpage when empty, with this Snippet in the themes/functions.php…
// check for empty-cart get param to clear the cart add_action( ‘init’, ‘woocommerce_clear_cart_url’ ); function woocommerce_clear_cart_url() { global $woocommerce; if ( isset( $_GET['empty-cart'] ) ) { $woocommerce->cart->empty_cart(); wp_redirect('https://ivsstiftelse.dk/'); exit; } }
but it doesn’t work.
What is wrong here?
Thx in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Woocommerce Empty Cart makes redirect Loop error’ is closed to new replies.