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

HPOS: Make sure billing and shipping address indexes are set on checkout #227

Closed
2 tasks done
james-allan opened this issue Oct 25, 2022 · 0 comments · Fixed by #228
Closed
2 tasks done

HPOS: Make sure billing and shipping address indexes are set on checkout #227

james-allan opened this issue Oct 25, 2022 · 0 comments · Fixed by #228
Assignees
Labels
compatibility: HPOS type: bug The issue is a confirmed bug.

Comments

@james-allan
Copy link
Contributor

Describe the bug

While testing #226 I discovered that the billing and presumably the shipping address indexes weren't being saved correctly on checkout.

Screen Shot 2022-10-25 at 11 38 09 am

Here's a comparison between trunk on the left and refactor-create-subscription on the right. Notice the billing address index only contains the email field.

To Reproduce

  1. Purchase a subscription on the refactor-create-subscription branch.
    • no HPOS setup is required. Just using the wp post architecture is fine.
  2. In the database look at the subscription and notice the billing address index is incomplete.

Expected behavior

The billing and shipping address indexes should be a concatenation of the all address fields.

Actual behavior

Product impact

  • Does this issue affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • Does this issue affect WooCommerce Payments? yes/no/tbc, add issue ref

Additional context

This issue happens because of the wcs_copy_order_address() function which uses a legacy function set_address() to copy the address data. That function sets the address data directly into post meta which means that when the subscription is eventually saved, those billing fields aren't updated here which causes the indexes to not be updated.

We should replace the set_address() with modern APIs.

@james-allan james-allan added type: bug The issue is a confirmed bug. compatibility: HPOS labels Oct 25, 2022
@james-allan james-allan changed the title HPOS: Update wcs_copy_order_address() to use modern APIs HPOS: Make sure billing and shipping address indexes are set on checkout Oct 25, 2022
@james-allan james-allan self-assigned this Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility: HPOS type: bug The issue is a confirmed bug.
Projects
None yet
1 participant