You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing #226 I discovered that the billing and presumably the shipping address indexes weren't being saved correctly on checkout.
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
Purchase a subscription on the refactor-create-subscription branch.
no HPOS setup is required. Just using the wp post architecture is fine.
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.
The text was updated successfully, but these errors were encountered:
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
Describe the bug
While testing #226 I discovered that the billing and presumably the shipping address indexes weren't being saved correctly on checkout.
Here's a comparison between
trunk
on the left andrefactor-create-subscription
on the right. Notice the billing address index only contains the email field.To Reproduce
refactor-create-subscription
branch.Expected behavior
The billing and shipping address indexes should be a concatenation of the all address fields.
Actual behavior
Product impact
Additional context
This issue happens because of the
wcs_copy_order_address()
function which uses a legacy functionset_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.The text was updated successfully, but these errors were encountered: