Skip to content

Add fulfillments to customer order details page #58713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tpaksu
Copy link
Contributor

@tpaksu tpaksu commented Jun 11, 2025

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR decorates the customer order details page, and the order tracking page contents with the fulfillment information available. Only the fulfilled fulfillments are displayed on the order information page, draft fulfillments are not shown. This PR also includes a new FulfillmentUtils utility class that contain static methods to help extracting the information required from the fulfillments and the order.

Closes #57424 WOOPLUG-4582 WOOPLUG-4019

Screenshots or screen recordings:

Order details page:

image

Order tracking page:

image

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Checkout this branch
  2. Run composer dumpautoload just in case the FulfillmentUtils file is not loaded via the autoloader.
  3. Create some fulfillments for an order with refunds, multiple quantities, different fulfillment statuses, different items.
  4. Go to the store and open My account > Orders page
  5. Open the order details and see the new structure
  6. Open an order without fulfillments, see that the old structure is displayed
  7. Create a new page, and add [woocommerce_order_tracking] shortcode into it
  8. Save the page, and navigate to it
  9. Use the order ID and the billing email address to open the order tracking information
  10. Check the contents and see if it contains fulfillment information
  11. Track the order with no fulfillments, see that the old design is applied.
  12. Check if the design matches with 2xydCrrB4yb2TAqpXt607y-fi-3274_51696

Testing that has already taken place:

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

Modify customer order details page, and the order tracking page to display fulfillment information.

@tpaksu tpaksu linked an issue Jun 11, 2025 that may be closed by this pull request
@@ -177,41 +177,6 @@ function ( $provider ) {
}
}

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to FulfillmentUtils file.

@tpaksu tpaksu marked this pull request as ready for review June 13, 2025 11:27
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jun 13, 2025
@tpaksu tpaksu requested review from a team and ismaeldcom and removed request for a team June 13, 2025 11:27
@tpaksu tpaksu self-assigned this Jun 13, 2025
Copy link
Contributor

github-actions bot commented Jun 13, 2025

Testing Guidelines

Hi @ismaeldcom ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

Copy link
Contributor

github-actions bot commented Jun 13, 2025

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@ismaeldcom ismaeldcom left a comment

Choose a reason for hiding this comment

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

The testing instructions work as expected, but there are some minor design issues and a couple of questions about the implementation.

Implementation questions
I wonder if we should use woocommerce_order_details_before_order_table to inject the fulfillment details or embed the orders-details template in the order-details-fullfilments one. Otherwise, we will need to ensure both templates are in sync after every update.

This is more about the project itself, are we implementing fulfillments as an optional feature, or will we auto-fulfill some cases by default? 🤔 I'm thinking about a store with digital products that could end up having It has no fulfillments yet on every order.

Design issues

  • The issue with Storefront is how the second column is not aligned with the order details one, as the design states, although I don't see this that important.
  • With other designs I noticed that the fulfillment status is bolder instead of bold and doesn't use the mark tag. And the table doesn't have a 100% width.
Storefront Twenty Twenty-Five
Screenshot 2025-06-17 at 11 31 42 Screenshot 2025-06-17 at 11 31 54

/**
* Order details
*
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-details.php.
Copy link
Contributor

Choose a reason for hiding this comment

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

The path needs to be updated, and in the other template too 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in bc9d95b

@tpaksu
Copy link
Contributor Author

tpaksu commented Jun 17, 2025

Thanks for the review @ismaeldcom!

I wonder if we should use woocommerce_order_details_before_order_table to inject the fulfillment details or embed the orders-details template in the order-details-fullfilments one. Otherwise, we will need to ensure both templates are in sync after every update.

That makes sense. I needed the order-details-fulfillments because of the loop inside, we need to show different quantities of some items which exist in a fulfillment, than showing the full order items, so I needed a different loop. For the header part that shows the shipping date, we can use the hook.

This is more about the project itself, are we implementing fulfillments as an optional feature, or will we auto-fulfill some cases by default? 🤔 I'm thinking about a store with digital products that could end up having It has no fulfillments yet on every order.

We will be wrapping the project with a feature flag, but I was thinking of doing that after finishing the project work. There are many things to discuss after the implementation finished, such as:

  • UI Design discrepancies
  • Missing/wrong/broken parts of project features
  • Compatibility with other themes

I'm just now focusing on finishing what's written on the TSD (the created issues), putting the whole work on a test site, share final builds with HE's, designers, stakeholders, external integrators, etc., and planning to do the refinements later.

The issue with Storefront is how the second column is not aligned with the order details one, as the design states, although I don't see this that important.

With other designs I noticed that the fulfillment status is bolder instead of bold and doesn't use the mark tag. And the table doesn't have a 100% width.

Thanks for bringing that up, I wasn't sure about how to design this, it is using the design of the orders table (so I don't need to add another set of styles to the plugin), but it's hardcoded as bold. What I did was setting the table header inline style to have normal weight fonts, and then used <strong> to make the bold parts on the Figma bold. Maybe the <strong> is bolder than expected. I'll check why that table doesn't have 100% width like the orders table.

@tpaksu tpaksu requested a review from ismaeldcom June 17, 2025 11:15
Copy link
Contributor

@ismaeldcom ismaeldcom left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments and providing additional details. I was just curious about the approach, but I agree on focusing on the feature implementation for now 🙂

It looks good to me and works as expected now.

I still think we should avoid duplicating the order details template. Instead, we could do something like the $show_downloads one, rendering it conditionally in the original template. However, this case is much more complex, so I'll leave it up to you to decide whether to iterate on it again at a later stage of the project.

@tpaksu tpaksu merged commit bee6b3c into feature/57353-order-fulfillments-entity Jun 18, 2025
41 checks passed
@tpaksu tpaksu deleted the add/WOOPLUG-4019-order-fulfillments-update-customer-orders-page branch June 18, 2025 05:13
kalessil added a commit that referenced this pull request Jul 21, 2025
* Add new database tables for fulfillments (#57428)

* Add new database tables for fulfillments

* Add changefile(s) from automation for the following project(s): woocommerce

* Update fulfillment tables to use CURRENT_TIMESTAMP for `date_updated`, which replaces `date_created`

* Add auto update to current timestamp

* Remove setting `date_updated` automatically, making it managed via code

* Add `status` and `is_fulfilled` columns to fulfillments table

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Vladimir Reznichenko <kalessil@gmail.com>

* Add order fulfillments data store (#57429)

* Add new database tables for fulfillments

* Add changefile(s) from automation for the following project(s): woocommerce

* Initial commit

* Add fulfillment object and its data store

* Add changefile(s) from automation for the following project(s): woocommerce

* Move fulfillment related code to src folder

* Remove leftover code changes

* Fix unit test and linter error

* Update fulfillment tables to use CURRENT_TIMESTAMP for `date_updated`, which replaces `date_created`

* Add auto update to current timestamp

* Get datastore via dependency injection, rename date_created to date_updated

* Remove setting `date_updated` automatically, making it managed via code

* Convert errors to exceptions

* Add data and return types to class methods

* Add `status` and `is_fulfilled` columns to fulfillments table

* Refactor Fulfillment class to use data array for properties and update database insertion logic

* Add `read_fulfillments` method, add new column getters/setters, fix tests

* Set defaults, change reset approach

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Vladimir Reznichenko <kalessil@gmail.com>

* Add order fulfillments REST API endpoints (#57496)

* Add new database tables for fulfillments

* Add changefile(s) from automation for the following project(s): woocommerce

* Initial commit

* Add fulfillment object and its data store

* Add changefile(s) from automation for the following project(s): woocommerce

* Move fulfillment related code to src folder

* Remove leftover code changes

* Fix unit test and linter error

* Update fulfillment tables to use CURRENT_TIMESTAMP for `date_updated`, which replaces `date_created`

* Add auto update to current timestamp

* Get datastore via dependency injection, rename date_created to date_updated

* Remove setting `date_updated` automatically, making it managed via code

* Convert errors to exceptions

* Add data and return types to class methods

* Initial commit

* Create the base REST controller file

* Register the REST controller on container, add service provider

* Rename ServiceProvider, omit RestController from the name

* Add strict types declaration

* Add base of the REST methods

* Add `status` and `is_fulfilled` columns to fulfillments table

* Refactor Fulfillment class to use data array for properties and update database insertion logic

* Add `read_fulfillments` method, add new column getters/setters, fix tests

* Set defaults, change reset approach

* Complete fulfillments REST controller code

* Start adding tests

* Fix helper namespace, add strict types check to helper file

* Add more tests

* Finish tests

* Remove meta id assertions from meta data  tests

* Remove date_deleted field from test

* Replace using body params with JSON params, fix tests

* Implement not applying actions on deleted records

* Allow arrays to be saved as meta by saving all meta as JSON encoded to the DB

* Reduce duplicated code, improve array validation

* Throw exception instead of returning an error on fulfillment validation

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Vladimir Reznichenko <kalessil@gmail.com>

* Add base user interface for order fulfillments (#57732)

* Initial commit

* Add fulfillments drawer renderer and component

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comments and method naming

* Add tests

* Add check for null screen

* Test returning internal meta keyse to fix unit test error on Github

* Fix non-static method called as static method

* Remove fix attempt as it didn't work

* Fix test error caused by container mock

* Address multiple issues

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add fulfillment editor form on base user interface (#57758)

* Initial commit

* Add fulfillments drawer renderer and component

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comments and method naming

* Add tests

* Add check for null screen

* Test returning internal meta keyse to fix unit test error on Github

* Fix non-static method called as static method

* Remove fix attempt as it didn't work

* Fix test error caused by container mock

* Initial commit

* Add item listing and shipment information blocks

* Add checkbox selection details

* Fix bulk checkbox, add select all link

* Finish shipment information form

* Add notification box and buttons

* Add ShipmentFormContext, restructure components

* Refactor code, create fulfillments list

* Add fulfillment editor

* Fix items reverting after click, fix radio group on shipping options, keep order items visible when a fulfillment details are open

* Address multiple issues

* Add update, delete actions, shipping form manual edit names, componentize recurring code

* Add JS tests

* Fix issues with icons and images, add max-width to drawer

* Split PR into multiple PR's that solve only the focused issue

* Add disabled state when editing a fulfillment

* Disable other fulfillments when editing, add disabled states to buttons, fix test, fix fulfillment UI update after edit

* Add collapse to pending items, css styling

* Fix test

* Set order items open when no fulfillments are available

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Styling fixes, item price fixes

* Fix item selection

* Show new fulfillment form items as checked initially

* Skip disabling header on edit, exit edit mode on drawer close

* Small fixes

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add shipment information box on fulfillment editor (#57989)

* Initial commit

* Add fulfillments drawer renderer and component

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comments and method naming

* Add tests

* Add check for null screen

* Test returning internal meta keyse to fix unit test error on Github

* Fix non-static method called as static method

* Remove fix attempt as it didn't work

* Fix test error caused by container mock

* Initial commit

* Add item listing and shipment information blocks

* Add checkbox selection details

* Fix bulk checkbox, add select all link

* Finish shipment information form

* Add notification box and buttons

* Add ShipmentFormContext, restructure components

* Refactor code, create fulfillments list

* Add fulfillment editor

* Fix items reverting after click, fix radio group on shipping options, keep order items visible when a fulfillment details are open

* Address multiple issues

* Add update, delete actions, shipping form manual edit names, componentize recurring code

* Add JS tests

* Fix issues with icons and images, add max-width to drawer

* Split PR into multiple PR's that solve only the focused issue

* Add disabled state when editing a fulfillment

* Disable other fulfillments when editing, add disabled states to buttons, fix test, fix fulfillment UI update after edit

* Add collapse to pending items, css styling

* Fix test

* Set order items open when no fulfillments are available

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add shipment information box and tests

* Fix fulfillment shipping settings not updating as expected, add constants for meta keys, disable changing values on lookup form, fix tests

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Styling fixes, item price fixes

* Fix item selection

* Replace H4's with component labels, apply design to tracking number lookup result,  add useMemo to context values

* Show new fulfillment form items as checked initially

* Change icon color, undisable header, disable edit mode before closing drawer

* Skip disabling header on edit, exit edit mode on drawer close

* Small fixes

* Increase meta list font size

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add the fulfillment metadata display box (#58010)

* Initial commit

* Add fulfillments drawer renderer and component

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comments and method naming

* Add tests

* Add check for null screen

* Test returning internal meta keyse to fix unit test error on Github

* Fix non-static method called as static method

* Remove fix attempt as it didn't work

* Fix test error caused by container mock

* Initial commit

* Add item listing and shipment information blocks

* Add checkbox selection details

* Fix bulk checkbox, add select all link

* Finish shipment information form

* Add notification box and buttons

* Add ShipmentFormContext, restructure components

* Refactor code, create fulfillments list

* Add fulfillment editor

* Fix items reverting after click, fix radio group on shipping options, keep order items visible when a fulfillment details are open

* Address multiple issues

* Add update, delete actions, shipping form manual edit names, componentize recurring code

* Add JS tests

* Fix issues with icons and images, add max-width to drawer

* Split PR into multiple PR's that solve only the focused issue

* Add disabled state when editing a fulfillment

* Disable other fulfillments when editing, add disabled states to buttons, fix test, fix fulfillment UI update after edit

* Add collapse to pending items, css styling

* Fix test

* Set order items open when no fulfillments are available

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add shipment information box and tests

* Fix fulfillment shipping settings not updating as expected, add constants for meta keys, disable changing values on lookup form, fix tests

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add the fulfillment metadata display box

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Styling fixes, item price fixes

* Fix item selection

* Replace H4's with component labels, apply design to tracking number lookup result,  add useMemo to context values

* Show new fulfillment form items as checked initially

* Change icon color, undisable header, disable edit mode before closing drawer

* Skip disabling header on edit, exit edit mode on drawer close

* Small fixes

* Increase meta list font size

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add customer notification box to fulfillment editor form (#58551)

* Initial commit

* Add fulfillments drawer renderer and component

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comments and method naming

* Add tests

* Add check for null screen

* Test returning internal meta keyse to fix unit test error on Github

* Fix non-static method called as static method

* Remove fix attempt as it didn't work

* Fix test error caused by container mock

* Initial commit

* Add item listing and shipment information blocks

* Add checkbox selection details

* Fix bulk checkbox, add select all link

* Finish shipment information form

* Add notification box and buttons

* Add ShipmentFormContext, restructure components

* Refactor code, create fulfillments list

* Add fulfillment editor

* Fix items reverting after click, fix radio group on shipping options, keep order items visible when a fulfillment details are open

* Address multiple issues

* Add update, delete actions, shipping form manual edit names, componentize recurring code

* Add JS tests

* Fix issues with icons and images, add max-width to drawer

* Split PR into multiple PR's that solve only the focused issue

* Add disabled state when editing a fulfillment

* Disable other fulfillments when editing, add disabled states to buttons, fix test, fix fulfillment UI update after edit

* Add collapse to pending items, css styling

* Fix test

* Set order items open when no fulfillments are available

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add shipment information box and tests

* Fix fulfillment shipping settings not updating as expected, add constants for meta keys, disable changing values on lookup form, fix tests

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add the fulfillment metadata display box

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add customer notification box, connect it to REST API endpoints

* Styling fixes, item price fixes

* Fix item selection

* Replace H4's with component labels, apply design to tracking number lookup result,  add useMemo to context values

* Show new fulfillment form items as checked initially

* Change icon color, undisable header, disable edit mode before closing drawer

* Skip disabling header on edit, exit edit mode on drawer close

* Fix indenting errors after merge commit

* Add remove fulfilled fulfillment confirmation modal

* Small fixes

* Increase meta list font size

* Fix tests

* Add confirmation test

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add order fulfillment notification emails (#58558)

* Initial commit

* Add fulfillments drawer renderer and component

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comments and method naming

* Add tests

* Add check for null screen

* Test returning internal meta keyse to fix unit test error on Github

* Fix non-static method called as static method

* Remove fix attempt as it didn't work

* Fix test error caused by container mock

* Initial commit

* Add item listing and shipment information blocks

* Add checkbox selection details

* Fix bulk checkbox, add select all link

* Finish shipment information form

* Add notification box and buttons

* Add ShipmentFormContext, restructure components

* Refactor code, create fulfillments list

* Add fulfillment editor

* Fix items reverting after click, fix radio group on shipping options, keep order items visible when a fulfillment details are open

* Address multiple issues

* Add update, delete actions, shipping form manual edit names, componentize recurring code

* Add JS tests

* Fix issues with icons and images, add max-width to drawer

* Split PR into multiple PR's that solve only the focused issue

* Add disabled state when editing a fulfillment

* Disable other fulfillments when editing, add disabled states to buttons, fix test, fix fulfillment UI update after edit

* Add collapse to pending items, css styling

* Fix test

* Set order items open when no fulfillments are available

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add shipment information box and tests

* Fix fulfillment shipping settings not updating as expected, add constants for meta keys, disable changing values on lookup form, fix tests

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add the fulfillment metadata display box

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add customer notification box, connect it to REST API endpoints

* Styling fixes, item price fixes

* Fix item selection

* Replace H4's with component labels, apply design to tracking number lookup result,  add useMemo to context values

* Show new fulfillment form items as checked initially

* Change icon color, undisable header, disable edit mode before closing drawer

* Skip disabling header on edit, exit edit mode on drawer close

* Fix indenting errors after merge commit

* Add remove fulfilled fulfillment confirmation modal

* Small fixes

* Increase meta list font size

* Fix tests

* Add confirmation test

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Initial push

* Add fulfillment created emails and bind to actions

* Add plaintext fulfillment emails

* Add tests, rename file

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix code indentation error after merge

* Fix `woocommmerce` typo

* Fix comments and optimize code

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add fulfillments to customer order details page (#58713)

* Initial push

* Add customer order display modifications

* Fix error caused by null order

* Add changefile(s) from automation for the following project(s): woocommerce

* Add `_fulfilled_date` metadata automatically on fulfill

* Add date fulfilled getter/setter as a method of Fulfillment object

* Move fulfillment details into hook, fix file paths in comments

* Replace strong with mark on order status details text

* Replace &nbsp; with space

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add lock meta and it's handling (#58832)

* Add lock meta and it's handling

* Add JS tests

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Update design

* Update plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/lock-label.tsx

Co-authored-by: Fernando Espinosa <Ferdev@users.noreply.github.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Fernando Espinosa <Ferdev@users.noreply.github.com>

* Add bulk fulfillment actions (#58824)

* Initial push

* Add initial bulk actions code

* Handle fulfilling existing fulfillments of the order

* Add tests

* Add legacy CPT order type support

* Fix tests

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix utility method

* Remove unfulfill action

* Ensure items are saved as arrays

* Fix test

* Fix formatting after merge

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add filter and action for fulfillment creation (#58793)

* Add filter and action for fulfillment creation

* Remove metadata viewer test code

* Fix JS tests

* Refine fulfillment error message delivery via hooks

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Fix comment

* Modify fulfill items button to show message

* Optimize JS code

* Optimize missed JS code

* Remove code that tries to recreate fulfillment after deletion

* Fix alignment

* Apply patch to remove React checkbox component  warnings

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add initial shipping providers support (#58731)

* Initial push

* Add initial shipping providers support

* Fix tests

* Add strict types declaration

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add tests

* Fix test related to emails PR, unrelated with this one

* Improve comment, fix printing prices for orders without currency

* Use wp_localize_script instead of echo

* Revert wp_localize_script mods

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add filter and action for fulfillment update (#58810)

* Add filter and action for fulfillment creation

* Remove metadata viewer test code

* Fix JS tests

* Refine fulfillment error message delivery via hooks

* Initial push

* Add filter and action for fulfillment update

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix comment

* Modify fulfill items button to show message

* Modify update button to show error

* Optimize JS code

* Optimize JS code

* Optimize missed JS code

* Remove code that tries to recreate fulfillment after deletion

* Fix alignment

* Fix circular execution of hook

* Remove debug code

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add filter and action for fulfillment delete (#58812)

* Add filter and action for fulfillment creation

* Remove metadata viewer test code

* Fix JS tests

* Refine fulfillment error message delivery via hooks

* Initial push

* Add filter and action for fulfillment update

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add changefile(s) from automation for the following project(s): woocommerce

* Add filter and action for fulfillment delete

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix comment

* Modify fulfill items button to show message

* Modify update button to show error

* Modify remove button to show error

* Optimize JS code

* Optimize JS code

* Optimize JS code

* Optimize missed JS code

* Remove code that tries to recreate fulfillment after deletion

* Fix alignment

* Fix circular execution of hook

* Add check for action to prevent recursion

* Remove debug code

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add filter and action for fulfillment fulfilling (#58823)

* Add filter and action for fulfillment creation

* Remove metadata viewer test code

* Fix JS tests

* Refine fulfillment error message delivery via hooks

* Initial push

* Add filter and action for fulfillment update

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Add changefile(s) from automation for the following project(s): woocommerce

* Add filter and action for fulfillment delete

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix comment

* Add filter and action for fulfillment fulfilling

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Modify fulfill items button to show message

* Modify update button to show error

* Modify remove button to show error

* Update fulfill-items-button.tsx

* Optimize JS code

* Optimize JS code

* Optimize JS code

* Optimize missed JS code

* Remove code that tries to recreate fulfillment after deletion

* Fix alignment

* Fix circular execution of hook

* Add check for action to prevent recursion

* Add constraints for hooks, and param docblocks

* Remove debug code

---------

Co-authored-by: github-actions <github-actions@github.com>

* Fix fulfillment object rendering (#58978)

* Fix fulfillment object rendering

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix tests

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add fulfillments drawer to order details (#58859)

* Add filter by fulfillment status select to the orders list (#58865)

* Add the select to the orders list

* Add filter query

* Fix lint error

* Fix linter error

* Save order fulfillment statuses as order meta on each update

* Fix tests and bugs found from tests

* Make filters work both in legacy orders table and HPOS order table

* Remove initial order fulfillment status setting, and adjust filters

* Remove fulfillment status saving on table render

* Fix tests

* Add tests

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix merge conflicts and tests

* Fix select displaying labels properly

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add auto-fulfillment settings for virtual and downloadable items (#59085)

* Fix class autoloader, and add settings page mods

* Fix email rendering issues

* Add changefile(s) from automation for the following project(s): woocommerce

* Use order object instead of order_id and `wc_get_order` call

* Make the order check a bit more secure

* Change hooks used for auto-fulfillment covering all scenarios

* Defer settings modification to init to make product settings tests pass

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add `wc_fulfillment_statuses` filter, and utility to get status properties (#58963)

* Add the select to the orders list

* Add filter query

* Add filter and util

* Fix recursion by converting main filter to a getter

* Fix lint error

* Fix lint error

* Fix linter error

* Save order fulfillment statuses as order meta on each update

* Fix tests and bugs found from tests

* Make filters work both in legacy orders table and HPOS order table

* Remove initial order fulfillment status setting, and adjust filters

* Remove fulfillment status saving on table render

* Fix tests

* Add tests

* Add changefile(s) from automation for the following project(s): woocommerce

* Revert changes

* Add custom status support and rendering props

* Fix tests and merge conflicts

* Fix linter error after merge

* Allow plugins to modify order fulfillment status

* Add tests for fulfillment status filters

* Fix namespace

* Fix client scripts to display fulfillment statuses correctly

* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin

* Make is_fulfilled field private, and computed from status field, fix tests

* Remove private set_is_fulfilled call

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add filter for individual item auto-fulfillment (#59101)

* Add shipping provider PNG image logos and replace base64 encoded images (#59205)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>

* Convert shipping provider configuration arrays into shipping provider classes (#59214)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for UPS shipping provider (#59222)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add ambiguity scoring

* Shipping provider and test changes

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for USPS shipping provider (#59229)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Shipping provider and test changes

* Modify USPS parser code

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for FedEx shipping provider (#59248)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for DHL shipping provider (#59249)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for Amazon Logistics shipping provider (#59250)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Add tracking number parsing support for Amazon Logistics shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing **Amazon Logistics (TBA...)** tracking numbers in the fulfillment provider system. Amazon tracking numbers typically start with `TBA` and are specific to Amazon's delivery network.

Closes #59233 WOOPLUG-4816

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if you don't have one.
5. In the fulfillment shipping info box, use tracking numbers like the following:

```md
- TBA1234567890 (US → US) → ✅ Amazon Logistics
- TBA000000000X (CA → CA) → ✅ Amazon Logistics
- tba111222333 (GB → DE) → ✅ Amazon Logistics
- TBX1234567890 (US → US) → ❌ Not Amazon Logistics
- TBA1234567890 (US → BR) → ❌ Not Amazon Logistics

* Fix tests

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Shipping provider changes

* Fix lint errors

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for DPD shipping provider (#59256)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Add tracking number parsing support for Amazon Logistics shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing **Amazon Logistics (TBA...)** tracking numbers in the fulfillment provider system. Amazon tracking numbers typically start with `TBA` and are specific to Amazon's delivery network.

Closes #59233 WOOPLUG-4816

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if you don't have one.
5. In the fulfillment shipping info box, use tracking numbers like the following:

```md
- TBA1234567890 (US → US) → ✅ Amazon Logistics
- TBA000000000X (CA → CA) → ✅ Amazon Logistics
- tba111222333 (GB → DE) → ✅ Amazon Logistics
- TBX1234567890 (US → US) → ❌ Not Amazon Logistics
- TBA1234567890 (US → BR) → ❌ Not Amazon Logistics

* Fix tests

* Add tracking number parsing support for DPD shipping provider

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Shipping provider changes

* Fix lint errors

* Shipping provider changes

* Fix linter error

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

* Prioritize DPD over FedEx in EU

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for Evri (Hermes) shipping provider (#59298)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Add tracking number parsing support for Amazon Logistics shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing **Amazon Logistics (TBA...)** tracking numbers in the fulfillment provider system. Amazon tracking numbers typically start with `TBA` and are specific to Amazon's delivery network.

Closes #59233 WOOPLUG-4816

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if you don't have one.
5. In the fulfillment shipping info box, use tracking numbers like the following:

```md
- TBA1234567890 (US → US) → ✅ Amazon Logistics
- TBA000000000X (CA → CA) → ✅ Amazon Logistics
- tba111222333 (GB → DE) → ✅ Amazon Logistics
- TBX1234567890 (US → US) → ❌ Not Amazon Logistics
- TBA1234567890 (US → BR) → ❌ Not Amazon Logistics

* Fix tests

* Add tracking number parsing support for DPD shipping provider

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Shipping provider changes

* Fix lint errors

* Shipping provider changes

* Fix linter error

* Add tracking number parsing support for Evri (Hermes) shipping provider

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add tracking number parsing support for Canada Post shipping provider (#59308)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Add tracking number parsing support for Amazon Logistics shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing **Amazon Logistics (TBA...)** tracking numbers in the fulfillment provider system. Amazon tracking numbers typically start with `TBA` and are specific to Amazon's delivery network.

Closes #59233 WOOPLUG-4816

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if you don't have one.
5. In the fulfillment shipping info box, use tracking numbers like the following:

```md
- TBA1234567890 (US → US) → ✅ Amazon Logistics
- TBA000000000X (CA → CA) → ✅ Amazon Logistics
- tba111222333 (GB → DE) → ✅ Amazon Logistics
- TBX1234567890 (US → US) → ❌ Not Amazon Logistics
- TBA1234567890 (US → BR) → ❌ Not Amazon Logistics

* Fix tests

* Add tracking number parsing support for DPD shipping provider

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Shipping provider changes

* Fix lint errors

* Shipping provider changes

* Fix linter error

* Add tracking number parsing support for Evri (Hermes) shipping provider

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

* Add Canada Post shipping provider tracking number parsing

* Add Canada Post icon

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add Royal Mail shipping provider tracking number parsing (#59311)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Add tracking number parsing support for Amazon Logistics shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing **Amazon Logistics (TBA...)** tracking numbers in the fulfillment provider system. Amazon tracking numbers typically start with `TBA` and are specific to Amazon's delivery network.

Closes #59233 WOOPLUG-4816

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if you don't have one.
5. In the fulfillment shipping info box, use tracking numbers like the following:

```md
- TBA1234567890 (US → US) → ✅ Amazon Logistics
- TBA000000000X (CA → CA) → ✅ Amazon Logistics
- tba111222333 (GB → DE) → ✅ Amazon Logistics
- TBX1234567890 (US → US) → ❌ Not Amazon Logistics
- TBA1234567890 (US → BR) → ❌ Not Amazon Logistics

* Fix tests

* Add tracking number parsing support for DPD shipping provider

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Shipping provider changes

* Fix lint errors

* Shipping provider changes

* Fix linter error

* Add tracking number parsing support for Evri (Hermes) shipping provider

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

* Add Canada Post shipping provider tracking number parsing

* Add Canada Post icon

* Add Royal Mail shipping provider tracking number parsing

* Add S10 check digit validation for UPU format

* Fix wrong merge and failing tests because of it

* Fix comment

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add Australia Post shipping provider tracking number parsing (#59320)

* Add shipping provider PNG image logos and replace base64 encoded images

* Add changefile(s) from automation for the following project(s): woocommerce

* Convert shipping provider configuration arrays into shipping provider classes, adapt UI and JS variable export to changes

* Add tests

* Fix namespace

* Fix class name case

* Fix another classname case issue

* Add tracking number parsing support for UPS shipping provider

* Fix shipping provider class initialization with DI

* Fix tracking number parse response handling

* Fix test

* Fix namespace of test file

* Add tracking number parsing support for USPS shipping provider

* Add ambiguity scoring

* Add ambiguity scoring

* Add tracking number parsing support for FedEx shipping provider

* Add tracking number parsing support for DHL shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).
-   Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing DHL tracking numbers within the fulfillment provider system.

Closes #59204 WOOPLUG-4802

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if needed
5. In the shipping information box, enter the following tracking numbers:

#### ✅ Valid DHL
- `1234567890` (DE → US) → DHL (Score: 80)
- `JJD1234567890` (US → FR) → DHL (Score: 95)
- `JJD00123456789012` (GB → IT) → DHL (Score: 95)

#### ❌ Not DHL
- `INVALID1234` (DE → US)
- `JJD123` (JP → GB)
- `1234567890` (ZZ → US)

Verify correct results appear in the fulfillment drawer.

### Changelog entry

-   [x] This Pull Request does not require a changelog entry. (Comment required below)

<details>
<summary>Changelog Entry Details</summary>

#### Significance
-   [x] Patch

#### Type
-   [x] Add - Adds functionality

#### Message
</details>

<details>
<summary>Changelog Entry Comment</summary>

#### Comment
This is a part of a feature branch which will have a single changelog entry when merged to trunk.
</details>

* Add tracking number parsing support for Amazon Logistics shipping provider
### Submission Review Guidelines:

-   I have followed the [WooCommerce Contributing Guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) and the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
-   I have checked to ensure there aren't other open [Pull Requests](https://github.com/woocommerce/woocommerce/pulls) for the same update/change.
-   I have reviewed my code for [security best practices](https://developer.wordpress.org/apis/security/).

### Changes proposed in this Pull Request:

This PR adds initial support for detecting and parsing **Amazon Logistics (TBA...)** tracking numbers in the fulfillment provider system. Amazon tracking numbers typically start with `TBA` and are specific to Amazon's delivery network.

Closes #59233 WOOPLUG-4816

### How to test the changes in this Pull Request:

1. Checkout this branch
2. Run `pnpm run watch:build`
3. Run `composer dumpautoload` if needed
4. Go to WooCommerce > Orders and create a fulfillment if you don't have one.
5. In the fulfillment shipping info box, use tracking numbers like the following:

```md
- TBA1234567890 (US → US) → ✅ Amazon Logistics
- TBA000000000X (CA → CA) → ✅ Amazon Logistics
- tba111222333 (GB → DE) → ✅ Amazon Logistics
- TBX1234567890 (US → US) → ❌ Not Amazon Logistics
- TBA1234567890 (US → BR) → ❌ Not Amazon Logistics

* Fix tests

* Add tracking number parsing support for DPD shipping provider

* Shipping provider and test changes

* Modify USPS parser code

* Shipping provider changes

* Shipping provider changes

* Shipping provider changes

* Fix lint errors

* Shipping provider changes

* Fix linter error

* Add tracking number parsing support for Evri (Hermes) shipping provider

* Boost score when one of the countries is US

* Elaborate Surepost format

* Add all matches to parsing results, normalize tracking number

* Add Canada Post shipping provider tracking number parsing

* Add Canada Post icon

* Add Royal Mail shipping provider tracking number parsing

* Add S10 check digit validation for UPU format

* Add Australia Post shipping provider tracking number parsing

* Add Australia Post logo

* Join country list to one single line

* Fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>

* Add feature flag for order fulfillments (#59148)

* Add feature flag for order fulfillments

* Add changefile(s) from automation for the following project(s): woocommerce

* Isolate email modifications with feature flag

* Fix tests

* Move DB schema from installation to activation

* Add DB tables only when the feature is first enabled, hide feature UI

* Fix tests

* Fix more tests

* Remove the condition for adding fulfillments tables, make them always listed

---------

Co-authored-by: github-actions <github-actions@github.com>

* Fix fulfillments UI design issues found in design review (#59380)

* Change chevron direction, remove bulk selection labels, collapse new fulfillment form

* Prevent body scrolling on drawer open, refactor drawer classes, scroll to error message on error

* Make "Other" shipping provider option sticky at bottom

* Update order fulfillment status in real time

* Fix tests

* Disable collapsing when there's only one fulfillment with all items in the drawer

* Fix lint and test issues

* Fix hasPendingItems method, clear error messages when order changes

* Fix CSS style lint issues, formatter breaks it

* Fix scrollintoview margin issue

* Merge branch 'feature/57353-order-fulfillments-entity' into fix/58715-fix-design-review-problems

* Fix lint error caused by line length limit

* Align price text to right

* Fix lint error

* Add mocking for scrollIntoView in jest tests

* Add UX improvements for tracking number lookup (#59427)

* Add UX improvements for tracking number resolution

* Fix linter error

* Fix tests

* Remove unnecessary utility, fix conditional rendering

* Add support for querying deleted fulfillments programmatically on backend (#59504)

* Add refunds handling to fulfillments (#59585)

* Add refunds handling to fulfillments

* Don't remove refunded item…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Order fulfillments] Update customer orders page
2 participants