Fix conditonal on cart redirect

Closes #16724
This commit is contained in:
Mike Jolley 2017-09-06 13:44:30 +01:00
parent 2aa735a334
commit 6ff78e29fe
1 changed files with 1 additions and 1 deletions

View File

@ -752,7 +752,7 @@ class WC_Form_Handler {
}
// 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 );