Cart is empty after Registration....

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi...

I'm using Nop 2.30...

Suppose i am guest user...

and I've added some products in cart...
at check out time...according to validation... it redirect to login page....coz i'm not registered user ...but at same time cart is not empty...and it display my number of product...

Now I'm registered user coz i've registered my account  ....and after registration my cart will empty.....
So how can i get my product back into cart....???

What should i do...???? should i repeat same process as registered user and then check out.....???
should i search those products again...????

it should redirect to cart page.....and then i will be able to check out....

How can i solve it..??

Give some hint....to solve this problem...


Thank You...
12 years ago
Have you found a solution ?
12 years ago
I'm using Nop 2.30 and I don't have that problem.  I put items in cart, checkout, redirects to login, I click register, complete form, see "Your registration completed", and still have items in shopping cart and can hit checkout btn.
12 years ago
I checked it and the issue does not exist in v2.3. Please recheck and elaborate a bit on the original scenario if it is replicated.
12 years ago
It is replicated:

I have the version 2.30
- The member choose a variant and add it into his cart => the cart appears
- the member accept condition and click on checkout => the login/register page appears
- i click register => the register form appears
- i fill the form and valid => an information page appear : THEN MY CART IS EMPTY

- i go to my email client and click on the token link => i go back to the site and see that my cart is empty

----
This process can be checked on the production server : http://www.rueduscooter.com

I can't understand why ?
12 years ago
I found the problem but i do not know how to solve it :

After the registration, the user is redirected to RegisterResult. The WorkContext is initialised and the Customer is retrieved from the customercookie  in WebWorkContext.cs:GetCurrentCustomer().

BUT the customer is not considered has registered (becaused it it not active) and a guest cutsomer is created:

var customerByCookie = _customerService.GetCustomerByGuid(customerGuid);
if (customerByCookie != null && !customerByCookie.IsRegistered() && !customerByCookie.IsSearchEngineAccount())
                                customer = customerByCookie;

I think it should be:

var customerByCookie = _customerService.GetCustomerByGuid(customerGuid);
if (customerByCookie != null && !customerByCookie.IsRegistered(false) && !customerByCookie.IsSearchEngineAccount())
                                customer = customerByCookie;

What do you think ?
12 years ago
I look to the code and i cannot figure how it could work for others.  Have you Email Verification activated ?
12 years ago
Do not loose your time to read my post : i do not see the not IsRegistered()

But i am still stick ...
12 years ago
the truth is out there.
In fact the AccountActivation() do not autologin the customer, so a Guest Customer is created with an empty cart. But if the customer logs in after Activation, the cart reappears.

BUT for the customer is very strange :
i have a cart, i validate my account, my cart is empty i do not want to restart my shopping,  i go away
OTHER scenario
i have a cart, i validate my account, i am autologged in, my cart is not empty, i am happy and i paid

this what i believed (perhaps the token must be destroy because if i lost it, someone can autologin)

What do you thing about ?
12 years ago
in fact i think that the cart and the customer must have different lifecycle.
why when i logged out i loose my cart ?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.