Skip to Content

Block anonymous carts in Odoo eCommerce

November 18, 2026 by
WolfSaddle

If your Odoo shop leaves Add to cart open to anyone, a visitor who never signs in can still start a cart. That is convenient for a first-time shopper. It is also how draft quotations appear in Sales for people who are not customers — and for scripts that add products just to leave junk behind.

This post covers how to keep the catalog open for browsing, require a signed-in customer before a cart can start, and what to check after you install the app.

Why anonymous carts become a problem

On a standard Odoo eCommerce shop, a public visitor can add a product, change a quantity, or use a reorder route, and Odoo creates a draft sales order for that session. Those drafts pile up: abandoned carts, typo orders, and automated requests that were never going to be paid.

They are not harmless clutter. Someone has to triage them. They can also hide real orders, and they give a public visitor a foothold in your sales documents. Closing the shop is not the answer. Most teams still want guests to read product pages, compare items, and open the cart page. The gap is narrower: do not let a public visitor create or change a cart.

This is not a captcha, a bot detector, or a firewall. It is a rule about who is allowed to start a cart: a signed-in customer, not the public user.

What stays open, and what is blocked

Guests can still:

  • browse /shop
  • open /shop/cart
  • read a cart already stored on the session

Until they sign in, they cannot:

  • add a product to a cart
  • change a quantity or clear the cart
  • reorder into a new quotation
  • create a quotation from the generic website form on sales orders

On the product page and in the product grid, Add to cart is replaced with Sign in to buy, which returns the visitor to that same page. Quantity controls and Buy now are hidden for guests. Signed-in customers are unchanged.

How the rule is enforced

The same rule runs on the server, before the cart controller. A theme that replaces that controller cannot open a cart for a guest. Other code that asks the website to create a cart for the public user gets an empty result instead of a new draft quotation.

There is no setting to turn the app on. It takes effect when it is installed.

Set it up

Install Block Anonymous Carts on an Odoo 19 database that already has eCommerce. The app directory name must stay website_sale_block_anonymous_cart, so the shop's frontend assets resolve.

Then, in the website settings, set Website > Customer Account to Free sign up (B2C). That part matters. If signup is on invitation, or closed, a new guest cannot create an account and therefore cannot buy.

To confirm it is working, open /shop in a private window:

  • Product pages and product tiles should show Sign in to buy, not Add to cart. /shop and /shop/cart should still load.
  • An add-to-cart request from that visitor should not create a draft sales order.
  • After you sign in and add a product, a draft quotation is created as usual. Sign in to buy should return you to the page you were on.

Existing carts, events, and other caveats

A guest cart that already existed before the app was installed can still be checked out as a guest. Adding or changing lines on that cart stays blocked. If you are turning this on for a shop that already has guest sessions, expect a few of those older carts to complete; new guest carts will not start.

If you also use events, paid event tickets and paid booths — when those apps are installed — send the guest to sign in. Nothing is registered or booked for a public visitor. Free tickets stay available to guests. One edge case is worth knowing: a guest whose cart existed before install, and who then books a free booth, gets that booth line on the cart and cannot remove it. The booth is reserved only once that cart is checked out, which is standard Odoo behavior.

A short checklist

Before you rely on it in production:

  • ☐ App installed on Odoo 19 eCommerce; the directory name is website_sale_block_anonymous_cart
  • ☐ Website > Customer Account set to Free sign up (B2C)
  • ☐ Private window: /shop and /shop/cart still load
  • ☐ Private window: product pages and tiles show Sign in to buy; quantity controls and Buy now are hidden
  • ☐ Private window: an add-to-cart request does not create a draft sales order
  • ☐ After sign-in, adding a product works, and the visitor returns to the same page
  • ☐ If the shop already had guest sessions, decide how you will handle older carts that can still be checked out
  • ☐ If you sell event tickets or booths, confirm paid items require sign-in and that free tickets still work as you expect

Where WolfSaddle fits

We built Block Anonymous Carts for Odoo 19 Community eCommerce. Public visitors can still open the shop and the cart page. Adding a product, changing a quantity, clearing the cart, or reordering into a new quotation is refused until they sign in. Signed-in customers are unchanged. The rule is enforced on the server, before the cart controller, so a theme that replaces that controller cannot open a cart for a guest.

The app is on the Odoo Apps Store.

Questions? Email support@wolfsaddle.com.

This post is general information, not legal advice. Odoo is a trademark of Odoo S.A.

Print MICR checks on blank stock in Odoo