RFC: Enable Filtering Orders by Total Price #14154
adevinwild
started this conversation in
RFC
Replies: 1 comment 1 reply
-
|
This might be confusing if there are multiple currencies used. Since medusa doesn't work with conversion rates for currencies out of the box this is not very straight forward. Otherwise I would suggest to combine this filter with a currency selection. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In this RFC, I propose adding a new filter to the Admin UI and API that allows filtering orders by total price, utilizing the
order_summaryCurrent implementation
Currently, the API does not support filtering orders by their total amount. Due to this, the Admin UI lacks this capability, which is a highly requested feature by e-commerce managers for workflow optimization
Proposed implementation
We can leverage the existing
order_summarytable as the reference point for filtering. Theorder_summaryis generated upon order creation and automatically updated when the order state changes from what I understood (e.g., refunds, cancellations, or edits)Backend Changes
We'll extend the current validator (
AdminGetOrdersParams) with a new key :total. This input will be mapped to the summary interface:summary.totals.current_order_total. This specific field (current_order_total) is ideal as it remains synchronized with the computed totalFrontend Changes
We'll introduce a new filter to the Admin UI Orders table. This can be achieved by leveraging the existing
NumberFiltercomponent, which supports standard operators (e.g., gt, lt, eq)A PR containing the implementation is available here 🙌
#14146
Admin UI example
Beta Was this translation helpful? Give feedback.
All reactions