Anonymous users are supposed to have access to Commerce cart/checkout by default. In my current project cart remains empty for anonymous users, even if an order is created. When an anonymous user clicks on Add to cart, a new order is correctly created, with the Owned by anonymous status. This is fine, but:
While the current product page is reloaded as expected, the rule displaying the default message (Foo was added to your cart) is not fired
If I manually go to /cart, I get the Cart is empty message. /checkout returns a 404 error.
$_SESSION
remains empty (I precise this because ofcommerce_checkout_access()
).if (empty($_SESSION['commerce_cart_orders']) || !in_array($order->order_id, $_SESSION['commerce_cart_orders'])) { return FALSE; }
In fact, it seems that in anonymous context, the order cannot be seen.
How do I debug why the cart remains empty, and the order isn't visible to anonymous users?
My config: clean step by step Commerce install, not Kickstart; some custom line items ; Access checkout / View own orders of any type / View any product of any type permissions granted for anonymous.
admin/config/workflow/rules
) for add to cart etc.. It's possible something there may be the cause.commerce_cart_add_to_cart_form_submit()
is actually run, and if so step through it and report back on where things go a bit wrong?!