Skip to content

Conversation

@jonathansadowski
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR updates the code introduced in #28132, such that it's consistent with the generation of the surrounding elements of the date_query, and adds the column field to the 0th element of the date query.

How to test the changes in this Pull Request:

  1. From the WordPress general settings page (/wp-admin/options-general.php), set the timezone of your site to "UTC +4".
  2. Create a new order from WooCommerce > Orders > Add Order (/wp-admin/post-new.php?post_type=shop_order).
  3. Set the date created to 2021-05-14 @ 00:00.
  4. Create a REST API Key from WooCommerce > Settings > Advanced > REST API. Take note of the consumer key and secret.
  5. Make a request to the orders endpoint to verify that post_date_gmt is used. For example:
curl "https://[domain]/wp-json/wc/v3/orders?dates_are_gmt=true&after=2021-05-13T19:00:00&before=2021-05-13T22:00:00&consumer_key=[consumer_key]&consumer_secret=[consumer_secret]"

Replace [domain], [consumer_key], and [consumer_secret].
6. Verify that the order you created in step 2 is included in the results.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Changelog entry

Tweak - Updates the date_query usage in the CRUD controller to be consistent, generating an array of queries.

@jonathansadowski jonathansadowski added this to the 5.4.0 milestone May 14, 2021
Copy link
Contributor

@ObliviousHarmony ObliviousHarmony left a comment

Choose a reason for hiding this comment

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

This works great, thanks!

@ObliviousHarmony ObliviousHarmony merged commit bdef58f into trunk May 14, 2021
@ObliviousHarmony ObliviousHarmony deleted the fix/28132 branch May 14, 2021 19:58
@woocommercebot woocommercebot added release: add changelog Mark all PRs that have not had their changelog entries added. [auto] release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] labels May 14, 2021
@ObliviousHarmony ObliviousHarmony added changelog added and removed release: add changelog Mark all PRs that have not had their changelog entries added. [auto] labels May 14, 2021
@juliaamosova juliaamosova added REST/Store API/Webhooks Issues related to WooCommerce REST API. testing instructions added and removed release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto] labels May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

REST/Store API/Webhooks Issues related to WooCommerce REST API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants