Skip to content

Conversation

@toupper
Copy link
Contributor

@toupper toupper commented Nov 4, 2025

Description

With this PR, we filter orders with draft statuses from the orders list, as they don't need to be shown to the users.

Test Steps

  • Open POS

  • Add a product to the cart

  • Tap on checkout

  • Tap on back

  • Tap on checkout

  • Complete the order

  • Open Order List – Before: there is one order in auto-draft and one completed. Now: Just one completed

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@toupper toupper added this to the 23.7 milestone Nov 4, 2025
@toupper toupper requested a review from malinajirka November 4, 2025 12:19
@toupper toupper added type: task An internally driven task. feature: POS labels Nov 4, 2025
@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit6a4f444
Direct Downloadwoocommerce-wear-prototype-build-pr14893-6a4f444.apk

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit6a4f444
Direct Downloadwoocommerce-prototype-build-pr14893-6a4f444.apk

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.27%. Comparing base (ae62311) to head (6a4f444).

Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #14893   +/-   ##
=========================================
  Coverage     38.27%   38.27%           
- Complexity    10101    10102    +1     
=========================================
  Files          2137     2137           
  Lines        120998   120998           
  Branches      16579    16579           
=========================================
+ Hits          46309    46310    +1     
  Misses        69980    69980           
+ Partials       4709     4708    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

orderBy = OrderBy.DATE,
sortOrder = OrderRestClient.SortOrder.DESCENDING,
statusFilter = null,
statusFilter = "pending,processing,on-hold,completed,cancelled,refunded,failed",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that this approach won’t work if there are any custom statuses or if a new status is introduced. Because of that reason, Povilas decided not to filter out this way the checkout-draft status.

Also, can it be that auto-draft not returned by default in the new versions of Woo? I don't see them. I checked the source code with Ai and it says:

Copilot said: Auto-draft orders are excluded because WooCommerce registers
Auto-draft orders are excluded because WooCommerce registers that post‑status as non‑public (not exposed to REST) and the DraftOrders code/hooks explicitly remove draft/auto‑draft from order queries, so the orders list API omits them by default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are onto something, notice this comment:

 // Draft orders are not returned from the API. We need to re-fetch order list from the API
// when the order is new or its status changed from draft to another status.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I just tested on WooCommerce 10.2.0 and auto-drafts are not returned there. So this is apparently a change in the behavior of the API! I think we'll need to track whether it's intentional or not and either fix it or update the apps (not just POS, but even Order list).

@malinajirka malinajirka self-assigned this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: POS type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants