subtotalPredictor

cart · /react·functionthrows Error

Build a cart-level predictor that recomputes cost.subtotal from line unit prices times quantities. Marks costStale: true so consumers can grey out totals until the server confirms — unit-price-only math intentionally ignores discounts, taxes, and shipping.

Signature

@nordcom/commerce-cart

Returns

A producing a cart with the new subtotal and costStale: true.

Throws

Error
Error when any line's unitPrice.currencyCode differs from the cart subtotal currency (delegated to ).

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

Metadata@nordcom/commerce-cart@0.2.2Open in GitHub ↗

On this page