CartColumnHeads
The cart table's header row, Qty, Item, Price and Total, in the widths CartLine uses.
Import
import { CartColumnHeads } from '@tallyui/components';Usage
<CartColumnHeads showPrice={showPrice} />
<CartLine showPrice={showPrice} {...line} />Renders the header row above the cart's lines, with the labels Qty, Item, Price and Total in the same column widths as CartLine. The Cart hides the Price column when the cart is under 300 wide, or the window is under 768 wide or 480 tall, as the WCPOS cart does. Pass the same showPrice to the heads and to every line.
The heads read pos_cart.col_qty, pos_cart.col_item, pos_cart.col_price and pos_cart.col_total from the components' catalogue, so an I18nProvider translates them. The Qty column is narrow, so a translation uses the language's short form, as English uses Qty.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
showPrice | boolean | true | Shows the Price head |
columns | CartColumnSettings | — | Which columns show (v2's Cart Settings › Columns); pass the same value as each CartLine's columns; order sets the column order, and regularPrice adds a read-only Regular Price column |
picking | boolean | false | Heads the quantity column This payment (pos_checkout.this_payment), as WCPOS v2's split-by-item bill does; the Cart sets it while its picker is on |
className | string | — | Override row styles |