woocommerce
woocommerce copied to clipboard
REST API: Check if stock should be adjusted when updating order line items
Changes proposed in this Pull Request:
As described in #44085, changing the quantity of a line item in an on-hold order from WP Admin correctly adjusts the stock level of the product, but doing it via a REST API request does not. Unfortunately the process for updating line items via REST API is entirely separate from the process in the programmatic API used in WP Admin. This attempts to add in the missing stock adjustment without causing any undesirable side effects.
Fixes #44085
How to test the changes in this Pull Request:
- TBD
Changelog entry
- [ ] Automatically create a changelog entry from the details below.
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
Comment
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.
Hi @jorgeatorres,
Apart from reviewing the code changes, please make sure to review the testing instructions as well.
You can follow this guide to find out what good testing instructions should look like: https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions
Reassigning the reviewer since Vedanshu will be AFK for a while...