Summary
The Storefront recent orders widget always shows 0 in the order amount column because the widget renders order.meta.total, but the internal orders list response appears to come from the FleetOps index order resource, which does not include Storefront checkout totals in meta.
Current Behavior
The recent orders widget loads orders with:
GET storefront/int/v1/orders
from addon/components/widget/orders.js, then renders the table amount with:
{{format-currency order.meta.total order.meta.currency}}
from addon/components/widget/orders.hbs.
The displayed amount is always 0/empty. Research points to the backend response shape as the likely source:
- Storefront registers internal
orders through fleetbaseRoutes('orders') in server/src/routes.php.
Fleetbase\Storefront\Http\Controllers\OrderController extends the FleetOps internal order controller.
- FleetOps internal order controller defines an
$indexResource for list responses.
- The generic query path uses
$indexResource for collection responses.
- FleetOps' index order resource returns
meta as only ['_index_resource' => true], so Storefront-specific meta.total, meta.subtotal, and meta.currency are not present in the recent-orders list payload.
This means the widget is asking for the correct Storefront checkout total field, but the list API response no longer carries the required Storefront order total data.
Expected Behavior
The recent orders widget should show the correct Storefront order total and currency for every order.
The amount column should continue to render through the {{format-currency}} helper using a numeric total and currency code from the order response, for example:
{{format-currency order.meta.total order.meta.currency}}
or an equivalent Storefront-specific response field if the backend intentionally exposes totals outside meta.
Steps to Reproduce
- Create or find a Storefront order with a non-zero checkout total.
- Open the Storefront home dashboard / recent orders widget.
- Observe the order amount column in the recent orders table.
- Compare the displayed amount to the checkout/order total stored for the Storefront order.
Affected Area
- Recent orders widget:
addon/components/widget/orders.js
- Recent orders widget template:
addon/components/widget/orders.hbs
- Internal Storefront orders API:
storefront/int/v1/orders
- Storefront internal order controller:
server/src/Http/Controllers/OrderController.php
- Storefront order filter:
server/src/Http/Filter/OrderFilter.php
- FleetOps internal order list/index resource currently used by inherited query behavior
Proposed Fix
Fix the response shape feeding the Storefront recent orders widget so Storefront order totals are included reliably.
Recommended direction:
- Add a Storefront-owned internal orders list response or resource for
storefront/int/v1/orders instead of relying directly on the FleetOps order index resource.
- Ensure the list response includes Storefront checkout totals and currency, either under
meta.total / meta.currency for compatibility with existing Storefront UI or as a clearly named Storefront amount field paired with a frontend update.
- Preserve the existing Storefront filtering behavior: current company,
meta->storefront_id, payload relationships, tracking number/status requirements, active-store filter, sort, limit, and status filter.
- Keep the recent orders widget amount rendered through
{{format-currency}}.
- Review related Storefront order views that also read
order.meta.total, including customer/order panels, so the fix does not only patch the home widget while leaving the same broken response shape elsewhere.
Avoid fixing this only by switching the widget to transaction_amount: FleetOps transaction amounts can be zero for orders created without a paid transaction, while Storefront checkout totals are stored in Storefront order metadata during checkout capture.
Acceptance Criteria
Documentation Impact
No public documentation update appears required unless the API response contract for Storefront internal orders is intentionally documented.
API Reference Impact
This affects an internal console API response shape, not the public Storefront API. No fleetbase/postman update appears required unless the internal Storefront orders endpoint is covered there.
Summary
The Storefront recent orders widget always shows
0in the order amount column because the widget rendersorder.meta.total, but the internal orders list response appears to come from the FleetOps index order resource, which does not include Storefront checkout totals inmeta.Current Behavior
The recent orders widget loads orders with:
GET storefront/int/v1/ordersfrom
addon/components/widget/orders.js, then renders the table amount with:{{format-currency order.meta.total order.meta.currency}}from
addon/components/widget/orders.hbs.The displayed amount is always
0/empty. Research points to the backend response shape as the likely source:ordersthroughfleetbaseRoutes('orders')inserver/src/routes.php.Fleetbase\Storefront\Http\Controllers\OrderControllerextends the FleetOps internal order controller.$indexResourcefor list responses.$indexResourcefor collection responses.metaas only['_index_resource' => true], so Storefront-specificmeta.total,meta.subtotal, andmeta.currencyare not present in the recent-orders list payload.This means the widget is asking for the correct Storefront checkout total field, but the list API response no longer carries the required Storefront order total data.
Expected Behavior
The recent orders widget should show the correct Storefront order total and currency for every order.
The amount column should continue to render through the
{{format-currency}}helper using a numeric total and currency code from the order response, for example:{{format-currency order.meta.total order.meta.currency}}or an equivalent Storefront-specific response field if the backend intentionally exposes totals outside
meta.Steps to Reproduce
Affected Area
addon/components/widget/orders.jsaddon/components/widget/orders.hbsstorefront/int/v1/ordersserver/src/Http/Controllers/OrderController.phpserver/src/Http/Filter/OrderFilter.phpProposed Fix
Fix the response shape feeding the Storefront recent orders widget so Storefront order totals are included reliably.
Recommended direction:
storefront/int/v1/ordersinstead of relying directly on the FleetOps order index resource.meta.total/meta.currencyfor compatibility with existing Storefront UI or as a clearly named Storefront amount field paired with a frontend update.meta->storefront_id, payload relationships, tracking number/status requirements, active-store filter, sort, limit, and status filter.{{format-currency}}.order.meta.total, including customer/order panels, so the fix does not only patch the home widget while leaving the same broken response shape elsewhere.Avoid fixing this only by switching the widget to
transaction_amount: FleetOps transaction amounts can be zero for orders created without a paid transaction, while Storefront checkout totals are stored in Storefront order metadata during checkout capture.Acceptance Criteria
{{format-currency}}with the correct currency code.Documentation Impact
No public documentation update appears required unless the API response contract for Storefront internal orders is intentionally documented.
API Reference Impact
This affects an internal console API response shape, not the public Storefront API. No
fleetbase/postmanupdate appears required unless the internal Storefront orders endpoint is covered there.