woocommerce icon indicating copy to clipboard operation
woocommerce copied to clipboard

REST API: Check if stock should be adjusted when updating order line items

Open coreymckrill opened this issue 1 year ago • 1 comments

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:

  1. 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

coreymckrill avatar May 24 '24 00:05 coreymckrill

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.

github-actions[bot] avatar May 24 '24 00:05 github-actions[bot]

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

github-actions[bot] avatar Jun 01 '24 00:06 github-actions[bot]

Reassigning the reviewer since Vedanshu will be AFK for a while...

coreymckrill avatar Jun 07 '24 23:06 coreymckrill