writeonce/docs/examples/ecommerce/ui/storefront.wo

25 lines
717 B
Text

-- Public product list. Live inventory — when a checkout reserves the last
-- unit, the "In stock" badge flips to "Out of stock" on every open browser
-- without refresh.
##ui
#storefront
title: "Shop"
source: Product
live: true
columns:
- meta.images[0] label: "" renderer: image
- name
- sku renderer: code
- price renderer: money
- available label: "In stock" renderer: stock-badge -- computed on Product
sort:
default: name asc
actions:
row-click: /product/:sku
add-to-cart: add_to_cart(self, 1) role: Customer | Ops | Admin
pagination: 24