WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Woocommerce adds 1 extra item to cart (9 posts)

  1. haleeben
    Member
    Posted 1 year ago #

    when adding an item to the cart, woocommerce is adding one additional item. If product quantity is 1 , 2 items show in cart, if product quantity is 2 , 3 items show in cart and so on.

    http://wordpress.org/extend/plugins/woocommerce/

  2. royho
    Member
    Posted 1 year ago #

    Most common cause of this is you have JS issues.

  3. angryjedi
    Member
    Posted 1 year ago #

    I am having the same issue. Were you able to figure it out, haleeben?

  4. haleeben
    Member
    Posted 1 year ago #

    Hey angryjedi

    What version are you using? I had the problem with version 1.6.5.2 but I think it's been fixed in version 1.6.6, try updating woocommerce, see if that works.

  5. fdzkuz
    Member
    Posted 1 year ago #

    The same. Not fixed in version 1.6.6. Please help.

  6. angryjedi
    Member
    Posted 1 year ago #

    Thanks for the tip, haleeben. I have been using 1.6.6 since I started this project, so unfortunately the problem seems to exist with the latest version as well. Any other tips?

  7. jadamsso
    Member
    Posted 1 year ago #

    I'm also having this issue. Is there any update on the cause and suggestions on how to fix it?

  8. haleeben
    Member
    Posted 1 year ago #

    I was using version 1.6.5.2 when I had the problem and to fix it I added this code to the woocommerce-functions.php file around line 361. But this has changed alot since then.

    // If we added the product to the cart we can now do a redirect, otherwise just continue loading the page to show errors
        if ($added_to_cart) {
    
    		$url = apply_filters( 'add_to_cart_redirect', $url );
    
    		// If has custom URL redirect there
    		if ( $url ) {
    			wp_safe_redirect( $url );
    			exit;
    		}
    		Add this code to fix the problem
    		// Redirect to cart option
    		elseif (get_option('woocommerce_cart_redirect_after_add')=='yes' && $woocommerce->error_count() == 0) {
    			wp_safe_redirect( $woocommerce->cart->get_cart_url() );
    			exit;
    		}
    
        }

    I think the best thing to do is to submit a bug through Github and see if Mike can help.
    https://github.com/woothemes/woocommerce/issues

  9. jadamsso
    Member
    Posted 1 year ago #

    Worked. Thank you for the huge time-saver in trying to track this down ourselves.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic