From 3a49e7a53b21b43ab177c93def43fdbb5d4c0178 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Wed, 22 May 2019 09:49:53 +0200 Subject: [PATCH] Clear notices after calling checkout/cart-errors.php to avoid duplicate notices on the cart page. cart-errors.php does not output notices but a general notice message yet error notices are still enqueued before calling the template. --- includes/shortcodes/class-wc-shortcode-checkout.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/shortcodes/class-wc-shortcode-checkout.php b/includes/shortcodes/class-wc-shortcode-checkout.php index f44911be77f..4b9265a56a2 100644 --- a/includes/shortcodes/class-wc-shortcode-checkout.php +++ b/includes/shortcodes/class-wc-shortcode-checkout.php @@ -272,6 +272,7 @@ class WC_Shortcode_Checkout { if ( empty( $_POST ) && wc_notice_count( 'error' ) > 0 ) { // WPCS: input var ok, CSRF ok. wc_get_template( 'checkout/cart-errors.php', array( 'checkout' => $checkout ) ); + wc_clear_notices(); } else {