Skip to content

Commit 6ff78e2

Browse files
committed
Fix conditonal on cart redirect
Closes woocommerce#16724
1 parent 2aa735a commit 6ff78e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/class-wc-form-handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ public static function add_to_cart_action( $url = false ) {
752752
}
753753

754754
// If we added the product to the cart we can now optionally do a redirect.
755-
if ( 0 === $was_added_to_cart && wc_notice_count( 'error' ) ) {
755+
if ( $was_added_to_cart && 0 === wc_notice_count( 'error' ) ) {
756756
// If has custom URL redirect there
757757
if ( $url = apply_filters( 'woocommerce_add_to_cart_redirect', $url ) ) {
758758
wp_safe_redirect( $url );

0 commit comments

Comments
 (0)