Skip to content

Commit

Permalink
Fix conditonal on cart redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Sep 6, 2017
1 parent 2aa735a commit 6ff78e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-wc-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 6ff78e2

Please sign in to comment.