eCommerce Cart Issues in Odoo
Customers report their shopping cart empties unexpectedly or products cannot be added:
Issues:
- Cart empties after navigating to another page
- "Your cart is empty" despite just adding products
- Product added but quantity shows 0
- Cart items disappear after login/logout
- Price shows as $0 or product shows unavailable in cartFix 1: Session Expiry
# The cart is stored in the user's session
# If the session expires, the cart is lost
# Check session timeout in odoo.conf:
# Default session lifetime: 7 days for logged-in users
# For public users: session expires with browser close
# Increase session lifetime:
# In odoo.conf (not a standard parameter, but can be set via code)
# Or configure in the website module settings
# Cookie issues:
# Check if the browser is blocking cookies from your domain
# Third-party cookie restrictions can affect sessions
# Ensure the Odoo domain uses SameSite=Lax cookiesFix 2: Product Became Unavailable
# If a product is unpublished or goes out of stock after adding to cart:
# The cart may show it as unavailable or remove it
# Check product availability:
# Website > eCommerce > Products > check publication status
# Inventory > Products > check stock quantity
# If using "Prevent sales of out-of-stock products":
# Website > Configuration > Settings > eCommerce
# Uncheck this option if products should remain in cart
# even when temporarily out of stockFix 3: Pricelist Issues
# Price computation errors can cause products to show $0
# Or prevent adding to cart
# Check the pricelist:
# Website > eCommerce > Pricelists
# Verify the public pricelist has prices for all products
# If using country-based pricelists:
# The visitor's detected country may not match any pricelist
# Add a fallback pricelist for "All Countries"
# Debug: Check the price computation
# In the website, add ?debug=1 to URL
# Check the product page for price anomaliesFix 4: Multi-Website Cart Isolation
# Each website has its own cart
# Switching between websites empties the cart
# If using multiple domains for the same Odoo website:
# Ensure all domains use the same website_id
# Otherwise carts are separate
# CDN subdomains should NOT be treated as different origins
# Cookies must be shared across the main domainFix 5: JavaScript Errors Preventing Cart Actions
# The "Add to Cart" button may silently fail due to JS errors
# Check browser console (F12) for errors:
# Common errors:
# - "RPC Error" — server-side error adding to cart
# - "TypeError" — JavaScript bug in custom theme
# - "NetworkError" — connection issue during request
# Fix: Clear assets and regenerate
# Settings > Technical > Attachments > delete asset bundles
# Restart Odoo
# Hard refresh (Ctrl+Shift+R)
# If a custom theme causes the issue:
# Try switching to the default theme temporarily to confirmFix 6: Cart Merging After Login
# When a visitor adds items while not logged in,
# then logs in, Odoo should merge the carts
# If cart empties on login:
# Check the sale order linking:
# The public user's sale order should transfer to the logged-in partner
# Verify:
sudo -u postgres psql -d mydb -c "
SELECT so.id, so.name, so.partner_id, rp.name as partner,
so.state, so.website_id
FROM sale_order so
JOIN res_partner rp ON so.partner_id = rp.id
WHERE so.state = 'draft'
AND so.website_id IS NOT NULL
ORDER BY so.create_date DESC LIMIT 10;
"Fix 7: Quantity and Product Variant Issues
# Adding a product variant that doesn't match:
# The cart may show quantity 0 or the wrong variant
# Check:
# Product variants must be published individually
# Each variant must have a price in the pricelist
# The variant combination must be valid (not excluded)
# Product > Variants tab > check each variant is sellable
# Product > Website tab > verify variant publishingPrevention
DeployMonkey's AI agent monitors eCommerce cart functionality, detects session issues, and validates pricelist configurations. The agent alerts on cart abandonment spikes that may indicate technical problems.