When adding an item to the shopping cart as anonymous. The message that says the item was added is displayed but the cart keeps showing up as empty.

Comments

rszrama’s picture

A little more specifics - the cart order is created, but it isn't reflected in the cart block or on the cart form. However, you can still access the checkout page for the order. The glitch also includes that you can't add more than one product to this cart order... it results in a new one each add.

sopratricx’s picture

Hello,

I get the same issue too. Just installed a fresh drupal build & all dev modules via drush and used 'commerce dev' profile (as had unrelated issue before http://drupal.org/node/1107788 ). All going well - I set up a new product type called 'tickets'. Both the standard 'products' & 'ticket' product types show up in the cart after you click add to cart in authenticated user mode but not in anonymous.

The message comes up saying - "Product added to your cart." but no sign in cart block or cart view page - it remains as 'Your shopping cart is empty.' Haven't been able to see the checkout.

How do we get around this?

Thanks.

Rich

googletorp’s picture

Status: Active » Needs review

It works in beta-3 which isn't long ago, so it wasn't to hard to figure out what caused this problem.

The problem is the commit made in #1147768: Product controller handling of ->created

The thing is that commerce presets a lot of empty values on it's entities when created, so it's not enough to check if they are set but also to check if they are empty, or in some cases just test if they are empty.

I've created a patch for this which is almost a revert of the commit from above, only without a redundant isset. Commited to my github repo: commit

rszrama’s picture

Status: Needs review » Fixed

Wow, thanks for digging that up so fast. Applied. I suppose we don't really need API support for being able to set "created" timestamps to 0... people can always just use 1 if something really got created in 1970. (Read: that's not how the system's supposed to be used anyways.)

And poo-poo on me for forgetting my anonymous user tests. This isn't the first time I've charged ahead forgetting the anonymous checkout workflow. :-/

googletorp’s picture

It comes in handy to have a live site where anonymous users are critical ;-)

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Version: 7.x-1.x-dev » 7.x-1.3

I have the same issue with 1.3 now, after upgrading from 1.2. However, reverting doesn't fix the issue, so it's likely a related module. Does anyone have the same problem?

hansrossel’s picture

Status: Closed (fixed) » Closed (duplicate)
Anonymous’s picture

Thanks a lot, this fixed it! Funny enough, I ran into this before (for showing products instead of product displays) but didn't realize this could be the same issue again for my empty cart...

What a relief ;-)

Cheers,
Stephan

vacho’s picture

Issue summary: View changes

I have this error now.

I have commerce 7.x-1.1 (the last version) but i understand what fail...

the shopping cart works great until a few months ago.

In fact in admin/commerce/orders/carts the requests look but in the shopping cart anonymous client is not displayed. The cart appears empty.

BartNijs’s picture

I came across the same problem a couple of minutes ago. I can see the cart contents in the backend, but for the anonymous user the cart appears empty.

freefuelforever’s picture

It could be a bunch of things, but check that

- you have an anonymous user role. it got deleted with me. So logged in users could see and add permissions to cart, others, not.

Of course, have to check anonymous has permission to access cart, add orders and that the commerce order redirect module is not trying to redirect to login.

freefuelforever’s picture

See this fellows long explanation of how to add anonymous user if yours deleted, or how to give permission for anonymous to access cart

http://drupal.stackexchange.com/questions/123960/commerce-anonymous-chec...