From 1be5e81860df97ea0d2efb9aed919480de7ac288 Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Thu, 10 Feb 2022 10:14:01 +0530 Subject: [PATCH] Fixed clear cart after payment for block-based themes(Twenty Twenty-Two). --- plugins/woocommerce/includes/wc-cart-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/wc-cart-functions.php b/plugins/woocommerce/includes/wc-cart-functions.php index 1d159c7d55a..a001455d01e 100644 --- a/plugins/woocommerce/includes/wc-cart-functions.php +++ b/plugins/woocommerce/includes/wc-cart-functions.php @@ -192,7 +192,7 @@ function wc_clear_cart_after_payment() { } } } -add_action( 'get_header', 'wc_clear_cart_after_payment' ); +add_action( 'template_redirect', 'wc_clear_cart_after_payment', 20 ); /** * Get the subtotal.