Account pages and orders
Design the customer account area, with each customer's own orders and details.
The account area is designed like any other page. A repeater source loops over the logged-in customer's orders, and dynamic fields fill in each order's details plus the customer's own name, email, and addresses.
Order history
Give a repeater the woocustomerorders source and it renders its inner layout once per order, newest first. The repeater's Count setting caps how many orders appear, ten when unset. Each row knows which order it belongs to, so the order fields inside it resolve to that order.
For now the fields are typed as tokens in a block's content, for example {ordernumber}; their entries in the dynamic inserter dropdown are coming.
| Token | What it shows |
|---|---|
{ordernumber} | The order number |
{orderdate} | The order date, in the site's date format; pass a PHP date format to override, e.g. {orderdate=d.m.Y} |
{orderstatus} | The status, as its readable name |
{ordertotal} | The order total, formatted with the currency |
{orderitemscount} | How many items the order contains |
{orderviewurl} | A link to the order's detail view in the account area |
Order fields render only for the order's own customer. Another visitor, or a logged-out one, sees nothing.
Customer and account fields
These work anywhere on the site for a logged-in visitor, not just inside the repeater.
| Token | What it shows |
|---|---|
{customername} | The customer's display name |
{customeremail} | The account email address |
{customerbillingaddress} | The billing address, formatted on one line |
{customershippingaddress} | The shipping address, formatted on one line |
{accounturl} | The URL of the My account page |
{logouturl} | A log-out link that returns to the homepage |