§5.10
Product wizard and cart
- Phase 11.1
- theme 1.11.0
The cart carries only the client's input; every amount, tax and eligibility decision arrives from the core price engine as formatted text. Templates do no maths, the browser produces no amounts, and forms contain no amount fields (ignored if sent).
| File | Data |
|---|---|
configureproduct.wcp |
$product (id, name, tagline, url, area, available, waitlist), $state (cycle, quantity), $form (cycles[value, label, price, setup, compare], steps, domain_choices, domain[mode, name, years], hostname, items[kind, key, type, name, description, required, price, options, field, value, values], license, module, allow_quantity, action, method, editing, has_secret, coupon), $summary (lines, subtotal, taxes, total, renewal) or null, $problems (engine messages), $links (cart, waitlist), $cart_days |
cart.wcp |
$items (id, name, engine, cycle, quantity, domain, details, amount, compare, errors, guest_blocked, edit_url, remove_url), $summary, $coupon (code, applied, error, discount) or null, $problems, $ok, $blocked, $count, $cart_days, $links (home, domains, coupon, checkout) |
Rules
- The wizard form posts to
$form['action'](with@method('PUT')when editing). Thename="action" value="preview"button only recalculates; any other submission adds to the cart. Field names are given in$form['items'][]['field']; the template does not build names. - Secret fields (transfer code, server password, password-type requirement) are never drawn with a value. If left empty when editing, the old value is kept (
$form['has_secret']). - On product cards and the product page
ordernow carriesurl.includes/order-button.wcpdraws a link for a sellable product and an accessible inactive button otherwise. Adding to the cart from the domain search uses thecartkey from 11.2 on (§5.11). - The cart link in the header is
$urls['cart']. - Page data keys do not clash with shared variables: page links arrive as
$links, engine messages as$problems($urls,$errorsare shared variables).