From 6ff78e29febd43e393546cc12a5c98a3bb29212b Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 6 Sep 2017 13:44:30 +0100 Subject: [PATCH] Fix conditonal on cart redirect Closes #16724 --- includes/class-wc-form-handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 02778e275634c..da073a87be96b 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -752,7 +752,7 @@ public static function add_to_cart_action( $url = false ) { } // If we added the product to the cart we can now optionally do a redirect. - if ( 0 === $was_added_to_cart && wc_notice_count( 'error' ) ) { + if ( $was_added_to_cart && 0 === wc_notice_count( 'error' ) ) { // If has custom URL redirect there if ( $url = apply_filters( 'woocommerce_add_to_cart_redirect', $url ) ) { wp_safe_redirect( $url );