Skip to content
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

fix(woocommerce): update how order meta are updated #2711

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Oct 20, 2023

All Submissions:

Changes proposed in this Pull Request:

As of WooCommerce 8.2, order meta are stored in a separate table and WP's post meta functions are no longer supported.

This PR updates to use methods from the WC_Order class.

How to test the changes in this Pull Request:

  1. Enable HPOS
  2. Make a donation using the Donate block, on a page with a ?utm_medium=some-medium param
  3. Note the order ID and run wp wc shop_order get <order-id> --field=meta_data*
  4. Observe the UTM param is listed in utm meta key

* In my local dev env, I had to specify a user, and I've used jq for readability, so in all it was: wp wc shop_order get <order-id> --user=1 --field=meta_data | jq '.'

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 ran tests with your changes locally?

@adekbadek
Copy link
Member

Closely related to #2124

@adekbadek adekbadek changed the base branch from master to trunk October 14, 2024 09:00
@adekbadek adekbadek marked this pull request as ready for review October 14, 2024 09:18
@adekbadek adekbadek requested a review from a team as a code owner October 14, 2024 09:18
@adekbadek adekbadek added the [Status] Needs Review The issue or pull request needs to be reviewed label Oct 14, 2024
@github-actions github-actions bot added the [Status] Approved The pull request has been reviewed and is ready to merge label Oct 14, 2024
@adekbadek adekbadek merged commit ae75548 into trunk Oct 14, 2024
9 checks passed
@github-actions github-actions bot removed the [Status] Needs Review The issue or pull request needs to be reviewed label Oct 14, 2024
@adekbadek adekbadek deleted the fix/wc-order-meta-update branch October 14, 2024 09:19
matticbot pushed a commit that referenced this pull request Oct 14, 2024
# [5.6.0-alpha.1](v5.5.1...v5.6.0-alpha.1) (2024-10-14)

### Bug Fixes

* cancelled subscriptions sync ([#3466](#3466)) ([6cad50a](6cad50a))
* **woocommerce:** update how order meta are updated ([#2711](#2711)) ([ae75548](ae75548))

### Features

* **metering:** dispatch RAS activity on content restriction ([#3437](#3437)) ([4e1c262](4e1c262))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.6.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Oct 28, 2024
# [5.6.0](v5.5.2...v5.6.0) (2024-10-28)

### Bug Fixes

* cancelled subscriptions sync ([#3466](#3466)) ([6cad50a](6cad50a))
* **woocommerce:** update how order meta are updated ([#2711](#2711)) ([ae75548](ae75548))

### Features

* add user name to woocommerce data events ([#3473](#3473)) ([2b57d27](2b57d27))
* command to initialize cron job to slowly backfill CAP term data ([#3425](#3425)) ([0b0d79a](0b0d79a))
* **metering:** dispatch RAS activity on content restriction ([#3437](#3437)) ([4e1c262](4e1c262))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants