Use the Sitegenerator standard cart

Use this quickstart when a Sitegenerator shop needs one server-owned purchase flow for consumers, verified business buyers, and quote-only business leads. After setup, cart totals, tax, shipping, checkout eligibility, quotes, and orders all use the Public Storefront contract.

Start with the generated cart page

New Sitegenerator projects contain /cart for English and /warenkorb for German. The page includes shop/standard-cart.html and loads the standard cart controller. The controller covers line changes, coupons, separate billing and shipping addresses, shipping, legal declarations, payment selection, order placement, quote requests, the PayPal handoff and recovery, and public order status.

Add a product action with public variant data:

html
<button
  data-nucleus-add-to-cart
  data-variant-id="VARIANT_UUID"
  data-quantity="1"
  data-unit-of-measure="PC"
>
  Add to cart
</button>

On a product page, the shop logic creates a cart when needed, adds the variant, and then opens /cart. When the action is already on the cart page, the same controller renders the complete cart response directly. Use data-nucleus-cart-url to select a different cart route or data-nucleus-cart-navigation="none" to stay on the current page. The browser never derives a tax jurisdiction, rate, tax amount, discount, or shipping total. When the server hides prices or requires a review, the cart does not show cached or calculated amounts.

Before adding an item, the module reloads the server cart and company context. It replaces a missing or completed cart only through the server recovery contract. If the completed cart still has a pending payment, that payment is preserved: the module opens the cart for recovery and does not append an item to the completed cart. Integrations can observe nucleus-standard-cart-item-added, nucleus-standard-cart-recovery-required, and nucleus-standard-cart-error.

Keep B2C and B2B paths separate

A consumer or guest sends billing and shipping addresses to POST /storefront/checkout/prepare. The server rebuilds the tax facts, reprices the cart, and returns a new pricing revision.

A verified business buyer first selects a company returned by GET /account/companies. Only buyer and administrator roles can use that context. The standard cart then offers the approved company billing and shipping addresses. A company name or an unverified VAT ID does not activate B2B tax treatment.

The initial EU pilot applies cross-border goods and general B2B service treatment only when the current evidence matches the determined customer country. Multi-establishment and triangular-transaction cases need dedicated presence and policy modules; do not unlock them in the browser by choosing a different VAT ID.

An unverified business lead can request a quote when the storefront allows it. Direct ordering remains unavailable until the server has validated the company and bound the buyer to it.

Respect pricing revisions

Use the pricing revision returned by checkout eligibility in the place-order request. Reload cart and eligibility after an address, company, quantity, coupon, shipping, or payment-context change. If the server reports a stale tax quote or a changed total, show the new amount and require confirmation.

The quote created from a cart stores the current commercial and tax snapshot. Before quote-to-order conversion, Workspace determines tax again. A material change requires reconfirmation; an accepted order, invoice, and accounting projection keep the immutable order tax snapshot.

Extend the reference flow safely

Every storefront-relevant feature must declare its B2C and B2B impact in the work order and list its capability IDs. Add evidence to sitegenerator-standard-cart-capabilities.json and run:

bash
task test:sitegenerator:standard-cart

If a feature does not apply to one audience, record the reason explicitly. Do not mark an untested path as covered.