subtotalPredictor
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
function subtotalPredictor(): CartPredictor;Returns
A producing a cart with the new subtotal and
costStale: true.
Throws
unitPrice.currencyCode differs from the
cart subtotal currency (delegated to ).Related
CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions
snapshotPredictor
Build a line predictor that derives a predicted cart line directly from the inline snapshot payload carried on an addline mutation. Lets callers ship known merc
useCartActions
Read the capabilitytyped actions object built by the provider. Throws when used outside <CartProvider because callers expect a guaranteed addLine/updateLine/rem