(written by Grok and reviewed by Max Milbers)
Audience: Templaters, consent-banner people, cart module authors
Files: media/com_virtuemart/js/cart/vmguestcart.module.js, helpers/cart.php
1. Why the myCart cookie went away
VirtueMart 4 wrote a myCart cookie for guests. Admin tabs remembered the open pane the same way. Cookie banners, size limits, and a cart the server had to parse on every request — or lose when the cookie was blocked.
VirtueMart 5 sets no cookies of its own. Guest cart, admin tabs, menu, sidebar: localStorage or the PHP session (Joomla’s cookie, not ours).
2. Guest cart
- PHP queues JSON (
queueGuestCartWebStorage). vmguestcart.module.jswriteslocalStorage.vm_myCart.- On the next page the module POSTs it to
restoreGuestCart; the server cart is whole again. - Logged-in carts stay in the database. Login clears guest storage.
HTTP is still strings; the restore is a POST with the payload, not a cookie header.
3. Admin UI
Tabs, open menu section, sidebar, offcanvas: Alpine + localStorage. Some function parameters are still named tabCookie so old calls do not explode. The value is not a cookie.
4. Cookie banners
If a banner still fires on a shop page, look at Joomla (session, language, login) or a third-party extension. Do not blame VirtueMart for a cart cookie that is gone.
Do not re-introduce document.cookie for cart or tabs in an override. If you persist UI state, use localStorage like core, or the session.