#768 "Add to Cart" button only working for logged-in users

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Damien BERENGER on Sunday, 26 April 2026 21:40 UTC

Damien BERENGER

Hello,

I am experiencing an issue where the "Add to cart" button only works for logged-in users.

I haven't changed the configuration recently, and it was working perfectly until April 21st (I have successful test orders from that date).

Current settings & behavior:

  • Who can see "Add to Cart"? is set to "Everyone".
  • The button is visible to guest users (not logged in).
  • The issue: When a guest user clicks "Add to cart", the button becomes greyed out (loading state), but nothing is added to the cart and the cart doesn't refresh.
  • However, as soon as I log in, the exact same button works perfectly.

Could you please help me identify what might be blocking the guest session or preventing the add-to-cart action for public visitors?

Thank you for your help

Olivier

Hi Damien,

I can see there is a json error after the submit.

The submission form links to "https://intergesty.fr/utilisateur/panier/addItem" which does not exist if the user is not logged in.

Note that it does not seem that your tests on the 21st were guest checkout, you were logged in.

I think the issue comes from the fact that your 'Panier' is in the user menu, it should be public to all.

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Damien BERENGER

Hi Olivier,

Thank you for your valuable advice!

I first tried creating a brand-new J2Commerce - Cart menu item in Public mode, but the issue persisted.

Then, following your lead, I took the original "Cart" menu item (which was in my User Menu set to "Registered") and simply switched it to "Public". And now, everything works perfectly! Thank you!

However, I'm trying to understand the logic behind this. I can't find anywhere in the J2Commerce configuration where this specific menu item is linked or selected.

What would happen if I were to delete this specific menu item? If I created a new one in the future, would it break again? It seems like the system is "stuck" to this original Itemid.

In any case, thank you very much for your help and interest in solving this!

Best regards, Damien

Olivier

Great Damien!

The logic behind it is actually very basic. The router, the Joomla engine that creates the urls, looks for the first item it can find that is stamped as 'cart'.

The first one found is used, regardless of access.

If you were to remove the cart menu item all together, you would end up with the system not knowing where to go and the cart would use the home page as fallback.

Same with articles: if there is no menu item like a blog for articles, the fallback is the home page (== the article will open in the home page).

Since the homepage is always public, it never is an issue for visitors, but may not be the desired result for the site builder...

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Damien BERENGER

Hi Olivier, ok it works, I understand everything now.

Thanks! I wish you all the best, Olivier!

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.