I need to debug an issue and don't know how to start.

If I'm logged in the cart works just fine but, if I log out and put something in my cart I see the object in the cart widget but not my cart page.

enter image description here

And this is the markup in the page.

page markup

I need a hint to understand where to start searching the issue because the cart page permission and the view permission I think are fine because I see them, but the content is wrong..

If I go in admin/structure/views/view/commerce_cart_form/edit page and I insert the order ID, I can see the right cart displayed in the right way..

Where can I start to debug this? Do you have a clue to where can the bug be?

I tried to put a couple of prints in the view header and the cart page remains blank. But why is the empty cart sentence not displayed if the order_id is empty?
And why 2 different carts views in the same page act so differently?


My guess is you're experiencing a common issue with product permissions due to a relationship you've added from the line item to the referenced product. Open your View's advanced settings fieldset, and in the Query settings menu disable SQL rewriting. This will bypass the normal entity access check to see if a customer has the permission to directly view the related product data, which is fine for this View since we know the products in the cart will always come from line items the customer has created through Add to Cart forms.

See also: https://drupal.org/node/1276450

  • 1
    Tried it. Disabling SQL rewriting works. – Randell Sep 22 '14 at 8:45
  • 1
    Geat !!!It worked for me. kudos to @Ryan Szrama – harshal Feb 6 '15 at 16:55

Another reason that other people might have is that anonymous user does not exist, got deleted somehow. So even if permissions allow anonymous to access cart, add orders, the cart remains empty because there is no anonymous role for users.

That is, uid=0 has to be in users table.

This fellow had a detailed answer that helped me, thanks to him: Commerce: anonymous checkout not working properly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.