Hi. I have a strange bug happening with my Drupal 6/UC 2.2 installation.

I require an account to be created for every purchase and this cannot be changed. When a customer go from cart to checkout - one is forwarded to login/register page. After successful registration a new user account is created, user logged in right away and the cart content is lost.

I do not have confirmation email for new accounts requirement - so after registration of new user - page redirects to cart and it says shopping cart empty (it was not empty before registration).

Is it still an issue in UC 2 or is it issue with any other module?

My install configuration is:

- UC 2.2
- Ubercart Addresses 6.x-1.0-rc1
- Ubercart Discounts (Alternative) 6.x-2.x-dev (2010-Jan-09)
- Ubercart Views 6.x-3.0
- UC Restrict Qty 6.x-2.x-dev (2009-May-17)
- UC Upsell 6.x-1.21
- uc_tablequote 6.x-2.0

Server is Centos 5.4 with Apache 2.2.3, MySQL 5.1.41, PHP 5.2.9 and jQuery 1.2.6

CommentFileSizeAuthor
#7 cart_lost_after_registration.png15.64 KBlunk rat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ivrh’s picture

Issue tags: +empty, +Ubercart, +checkout, +cart, +no anonymous

Any help at all? As it seems to be a major bug, going on since UC 1.x

TR’s picture

Category: bug » support

I cannot confirm this behavior. With Ubercart 2.2 and "Enable anonymous checkout (users can checkout without logging in)" disabled at admin/store/settings/checkout/edit, I can add items to the cart as an anonymous user, then when I try to checkout (by clicking on the "checkout" link in the cart block) I get a login page where I can login or register. With "Require e-mail verification when a visitor creates an account" unchecked at admin/user/settings, if I click "register" then fill out my user information, I'm automatically logged in with the cart still full. I am using Ubercart 2.2 and uc_addresses 6.x-1.0-rc1, but none of those other modules.

You say this has been "going on since UC 1.x", can you point to the issues where it was reported?

jeremy.zerr’s picture

I just tested this tonight and can confirm the cart contents stayed in tact. I'm running UC 2.2. One difference is that I have email verification enabled, which if anything, would probably make it harder to keep track of the cart contents.

Starting in as an anonymous user, I did the following:
1) added item to cart
2) clicked on checkout
3) was presented with login page and option to register, so clicked on register
4) entered registration details & received verification email
5) clicked one-time login link in email and changed password once logged in
6) checked cart and item added in 1) was there

I'm not really sure of the other modules you are using, I only had Ubercarts Discounts (Alt) installed, but maybe looking at the modules would be the next thing.

Jeremy Zerr - http://www.zerrtech.com

TR’s picture

Status: Active » Postponed (maintainer needs more info)
TR’s picture

Status: Postponed (maintainer needs more info) » Fixed

Two people have not been able to confirm the problem, and original poster has not responded to supply additional information, so I'm going to consider this issue fixed. You may reopen it if you continue to have the problem and can provide more details so the problem can be reproduced.

franz’s picture

Status: Fixed » Active

I had this issue too, but I had a different setup. I did want to have 'anonymous login' activated for common products, except for a few ones. So I had a custom module change the workflow on that case. Whenever a user had an account already, the cart is restored upon login. But if registration is done, upon login you can check that the SESSION is still active (there is an anonymous-like cart_id stored) but the cart is not updated to the user account.

Since the process of registration follows an special workflow in my case, I managed to workaround by calling uc_cart_login_update($user->uid) on user_register submit, which updates the cart before the login.

If you need anymore info.... I'm not so sure if I had exactly the same issue

lunk rat’s picture

I am having this problem too.

My configuration:

Drupal new user require email verification: off.

UC anonymous checkout: off.

Cart is full of items, click checkout, register for new account, submit successful account creation, get this:

Registration successful. You are now logged in.

There are no products in your shopping cart.

Latest stable UC 2.3 and Drupal 6

TR’s picture

Status: Active » Fixed

@Lunk Rat: Your problem is a UC 2.3 specific issue not related to this thread. See #858816: Unsetting cart session causes cart contents to be lost. Please participate in that thread to test the proposed fix.

@franz: I'm closing this thread again since your problems appear to come from your custom code, and are not a problem with Ubercart.

lunk rat’s picture

Status: Fixed » Active

Word; Thanks TR

TR’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ivrh’s picture

Assigned: Unassigned » ivrh
Status: Closed (fixed) » Fixed

I found the cause of this behavior and confirm now that it fixes all Ubercart 2 sites with this issue:

Resolution:
1. in your settings.php file comment all ini_set(); functions that you created. In my case this was "display_error",1 that was causing it.
2. Try if the issue resolved
3. Uncomment your customizations one by one and keep trying each time to see if issue didn't come back.

This particular issue depends on your web server type. In my case this was cPanel/Ceontos 5 (I am on www.firehost.com.au), but some hosts may have different settings so please post your variations here.

ecommercium’s picture

Well? What is the fix? When I place an order (not logged in) and at checkout I log in as an user, I get to the user profile page instead of where left off at the checkout page!! This is very anoying for our shop visitors! BTW, this does happen in IE and not FF on Mac.

Status: Fixed » Closed (fixed)
Issue tags: -empty, -Ubercart, -checkout, -cart, -no anonymous

Automatically closed -- issue fixed for 2 weeks with no activity.

Graham Leach’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Hello,

I think this problem is still in existence.

I am seeing two undesired behaviors on my website with respect to anonymous-> registered account transition. The problem happens when an anonymous user has already filled their shopping cart and s tarted the checkout process, then decides to join. They leave the checkout workflow and enter the registration workflow (which is OK) but their shopping cart is blown away.

The problems are as follows:

1) Shopping cart contents lost at time of registration

If an anonymous user fills their cart with items, then at time of checkout chooses to register to create an account, their shopping cart contents disappear once the registration process is completed. I think what happens here is that the system (for reasons I don't understand) clears the shopping cart at time of registration. This is not desired if you are registering as part of the checkout process.

2) User not returned to shopping cart checkout context post-registration

If a user should choose to register during the checkout process, their successful registration puts them at a results screen that has nothing to do with their checkout process, which can be disorienting for users.

If anyone wants to try this out, please visit www.holistichorsecare.com and/or contact me and I would be happy to troubleshoot this with anyone interested in researching and resolving this "problem", which is more like a gap in functionality between Ubercart and Drupal than a real error.

At worst, it's an "integration" error because it looks like the Drupal guys and the Ubercart guys don't (didn't) play together a lot.

Graham Leach
----

TR’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -empty, -Ubercart, -checkout, -cart, -no anonymous

@Graham Leach: You're using 6.x-2.2? Can you reproduce this on a clean install without other modules that affect the login/account creation process? Do some of your pages use HTTPS?

Graham Leach’s picture

Hello @TR

Just shop anonymously and then while in the checkout workflow elect to JOIN in mid-checkout, rather than before or after.

It looks to me like the join workflow includes deleting cookies and/or deleting or resetting the session, which clears the shopping cart.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Cannot reproduce this on your site - you are offered to register during checkout by filling in an email address, or log in to an existing account - or on a fresh install of Ubercart. If you are really still using 6.x-2.2 you should consider upgrading to the latest version.