Customer Orders
Build an order-history layout with WooCommerce order objects and BricksUltimate's Woo Order Details dynamic tags. Use it inside an authenticated account experience, with one repeated row or card per order.
Enable and Prepare
- Activate WooCommerce and BricksUltimate.
- Open Bricks → BricksUltimate → Misc, enable Ultimate Woo Query Builder, and save.
- Reopen the Bricks editor so the query options refresh.
Create test orders for at least two customer accounts. Work in a My Account layout protected by WooCommerce authentication, and keep account pages out of shared caches.
Create the Query Loop
- Add an outer Section or Block for the heading and layout. Keep the section heading outside the repeated item.
- Add an inner Block for one record and enable Use query loop on that Block.
- Choose Ultimate Woo Query Builder as the query Type, then choose Customer Orders under Woo query type.
- Enable Disable query merge where offered so the current page's main query does not unexpectedly constrain this custom collection.
- Configure the controls below and place the record's dynamic elements inside the repeated Block.
- Save and test on the frontend. Builder sample content is not a substitute for the live query result.
Controls and Behavior
| Control | How to use it |
|---|---|
| Type | All includes order and refund types; Orders selects shop_order; Refund Orders selects shop_order_refund. Refund queries can behave differently from normal customer orders, so test against actual data. |
| Status | Choose the statuses to include. With no selection, the query uses registered WooCommerce order statuses. |
| Customer | Currently logged in user is the normal choice for a customer-facing order history. All customers removes customer scoping; Custom user uses the specified User ID. |
| User ID | Shown for Custom user. Accepts dynamic data. Do not populate it from untrusted URL parameters. |
| Orders per page | Default: 10. The control allows 1 to 100; use a modest page size. |
| Order | DESC shows recent orders first; ASC reverses direction. The query is paginated and uses the My Account orders endpoint page number where available. |
Build an Order Row
- Choose Customer → Currently logged in user explicitly.
- Add headings for order number, date, status, total, and actions outside the repeated row.
- Inside the row, insert the order tags below rather than generic post fields.
- Use the View Order URL in a link control. Keep payment, cancellation, and reorder actions conditional on the order's actual eligibility.
- Add pagination outside the row, targeting this loop where supported. Test with more orders than the configured page size.
| Field | Dynamic tag |
|---|---|
| Order ID / display number | {bu_cust_order_id} / {bu_cust_order_number} |
| Date / status | {bu_cust_order_date} / {bu_cust_order_status} |
| Total / item count | {bu_cust_order_total_price} / {bu_cust_order_item_count} |
| Payment method | {bu_cust_order_payment_method_title} |
| View / pay URL | {bu_view_order_url} / {bu_pay_order_url} |
| Cancel / reorder URL | {bu_cancel_order_url} / {bu_order_again_url} |
An order number can differ from the internal order ID. Use the ID for data lookups and the display number for customer-facing labels. Never print order keys or private metadata in a public listing.
Practical Example
Build a My Orders list with 10 rows per page, Customer set to Currently logged in user, and Type set to Orders. Include a View Order link per row. Sign in as two different customers and verify that each sees only their own orders.
Scope and Limitations
The provider uses wc_get_orders(), rather than a direct order-post query, but this documentation is not a blanket compatibility guarantee for every order extension. It does not build the account login, enforce custom-route order ownership, or automatically choose valid action buttons. For order lines use the separate Ordered Items provider.
Troubleshooting and Testing
A guest does not have a currently logged-in customer scope and will not receive this account history. Editor preview can use sample order data for dynamic tags; verify the real logged-in frontend. If pagination repeats rows, check the account endpoint, target query, and cache configuration.
Test the populated and empty states, desktop and mobile layouts, and any relevant AJAX refresh. Keep headings and decorative wrappers from leaving empty gaps when no eligible results exist. If a query type is missing, verify the feature toggle, WooCommerce activation, and editor reload before changing the layout.