Skip to main content

The wr.account Object

The wr.account object is the primary access point for managing the authenticated user experience within the Reserved Area. It acts as a bridge to the Account Context, orchestrating navigation between different profile sections (orders, wishlist, settings) and the granular display of purchase-related data.

Usage and Purpose

It is used exclusively within pages that require authentication (user dashboard). It is essential for:

  • SPA Navigation: Moving from one section to another (e.g., from "Orders" to "Settings") without reloading the entire page.
  • Order Detail: Managing which order to display in the detail component when a user clicks on an item in the order list.
  • State Synchronization: Ensuring that all dashboard components react to the currently active section.

wr.account.state

Here is how the wr.account.state data structure appears when a user is viewing the details of an order:

{
"activeAccountSection": "orders",
"selectedOrder": {
"id": "5cdc8d20-a88d-46c2-98fc-f6db458d0b9b",
"storeId": "a7734977-c5b1-49a4-911c-0b0bf745bd4f",
"customerId": "00e72027-3672-4c12-a78f-e9ff744a0892",
"amount": "30.50000000",
"currencyCode": "EUR",
"paymentStatus": "paid",
"shippingStatus": "unassigned",
"stripeInvoiceUrl": "https://invoice.stripe.com/...",
"shippingTrackingUrl": null,
"createdAt": "2025-12-21T18:26:15.899Z",
"updatedAt": "2025-12-21T18:26:15.899Z",
"items": [
{
"productId": "5aa07d67-33e0-459c-ba9d-86b68d202e18",
"variantId": "1057deeb-024f-4a5b-9365-a3131aeb7826",
"skuId": "01e1c35f-8cb2-4c35-bd8b-1fa42dbc6a8c",
"variantName": "Cappellino nero",
"coverUrl": "https://webrounddev.b-cdn.net/rMa8bmEA2Yg9aYk5PgZPejecmIB2/a7734977-c5b1-49a4-911c-0b0bf745bd4f/commerce/images/1765018321978-Solid-Black-Baseball-Cap-Hat-with-Adjustable-Buckle-Back-Unisex_2b2bd9e5-d9df-4432-89e6-e22570e2de9e.bd72dfea18cccbcce241cbf7d35226c5.avif",
"quantity": 1,
"deliveryMethod": "shipping",
"appliedTaxRate": 22,
"unitNet": "17.00000000",
"unitGross": "20.74000000",
"unitTax": "3.74000000",
"totalNet": "17.00000000",
"totalGross": "20.74000000",
"totalTax": "3.74000000"
}
]
}
}

wr.account Utilities

These methods allow for the manipulation of the state described above.

MethodArgumentsDescription
setActiveAccountSectionsection: AccountSectionChanges the active section. Values: orders, subscriptions, reviews, wishlist, settings.
setSelectedOrderorder: Ordernull

State Properties

PropertyTypeDescription
activeAccountSectionstringThe identifier string of the current section.
selectedOrderOrdernull

Smooth Navigation

The integration of setActiveAccountSection allows for the creation of extremely reactive interfaces, where tab switching is instantaneous and managed entirely client-side by the webround.com engine.