Skip to content

Fix: Add compatibility with Woo HPOS. Allow order fields. #127

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

Merged
merged 20 commits into from
May 13, 2025

Conversation

cbravobernal
Copy link
Contributor

@cbravobernal cbravobernal commented May 8, 2025

What

With the last release of WooCommerce, a HPOS was introduced..

SCF needs some updates to be compatible with these new meta data management. One first bug that appeared is that if any user adds Order fields, these are not shown or updated in the order page. This PR fixes that.

How to test

You need a Woo (v 9.8.4) installed, at least one product and an order.

  • Create a Field, set the location as a Woo Order.
Screenshot 2025-05-10 at 14 43 27
  • Check that the field appears, can be filled and updated.
Screenshot 2025-05-10 at 14 44 15
  • Check that field can be called in a different PHP function.

How to test the meta optimization.

These checks are already included in this PR as e2e tests. But feel free to test them manually.

  • Create a Field, set the location as comment, option, user and term.
  • Check that field appears in any location, check that can be filled, edited and rendered with their respective PHP function.

@cbravobernal cbravobernal requested review from kraftbj and priethor May 8, 2025 17:01
@cbravobernal cbravobernal self-assigned this May 8, 2025
@cbravobernal cbravobernal added the [Type] Bug Something isn't working label May 8, 2025
@kraftbj
Copy link
Contributor

kraftbj commented May 9, 2025

Could you add a few testing instructions? I'd like to be sure I'm understanding what you're seeing and aiming to fix.

@cbravobernal
Copy link
Contributor Author

Could you add a few testing instructions? I'd like to be sure I'm understanding what you're seeing and aiming to fix.

I updated the description to include a small testing instructions. Also, I will finish today some e2e tests to include all test cases.

@cbravobernal
Copy link
Contributor Author

I will make another review after some rest time. The PR is ready, but still needs a double check to remove maybe not needed "AI" generated stuff on e2e tests, any wrong "since", or any duplicated or wrong comment due to duplicating files for tests.

@cbravobernal cbravobernal requested a review from kraftbj May 12, 2025 17:04
@cbravobernal cbravobernal marked this pull request as ready for review May 12, 2025 17:04
@cbravobernal
Copy link
Contributor Author

I forgot to push the last e2e. Now is ready.

@cbravobernal cbravobernal force-pushed the fix/show-fields-new-woo-sites branch from 3b1d9cd to fbaf52f Compare May 13, 2025 12:24
priethor
priethor approved these changes May 13, 2025
Copy link
Contributor

@priethor priethor left a comment

Choose a reason for hiding this comment

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

Since one of the latest commits, class initialization fails: the classes are trying to be loaded from includes/SCF/ folder, because of the namespace and autoloader configuration, instead of includes/Meta.

priethor

This comment was marked as duplicate.

@cbravobernal
Copy link
Contributor Author

Since one of the latest comments, class initialization fails: the classes are trying to be loaded from includes/SCF/ folder, because of the namespace and autoloader configuration, instead of includes/Meta.

Did you do a composer dump-autoload on your local system?

@priethor
Copy link
Contributor

Did you do a composer dump-autoload on your local system?

I hadn't before, but this didn't help, even though the autoloader setting seems correct.

@cbravobernal
Copy link
Contributor Author

Did you do a composer dump-autoload on your local system?

I hadn't before, but this didn't help, even though the autoloader setting seems correct.

You are right, I removed the SCF Meta on the composer file 🤦‍♂️

Copy link
Contributor

@priethor priethor left a comment

Choose a reason for hiding this comment

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

Everything works now as expected, @cbravobernal and I have been testing it for the last couple of hours.

@cbravobernal cbravobernal merged commit 91945b7 into trunk May 13, 2025
5 checks passed
@cbravobernal cbravobernal deleted the fix/show-fields-new-woo-sites branch May 13, 2025 17:36
@priethor priethor added this to the 6.5.0 milestone May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants