-
Notifications
You must be signed in to change notification settings - Fork 22
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
Merge feature/contact-info
branch into trunk
#943
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The previously added API endpoints for updating and fetching the phone number are now modified to also handle updating the business address. The endpoint name is changed from `phone-number` to `contact-information` but it still only accepts one `phone_number` input. However, now it also updates the address in Merchant Center to the store's address set in WooCommerce settings. The `GET` endpoint now also returns three extra parameters in its response: - `mc_address`: The address stored in Merchant Center - `wc_address`: The address stored in WooCommerce Settings - `is_mc_address_different`: A boolean indicating whether the two addresses above are different This also sets the country for the Merchant Center account but given that the MC accounts created by GLA are all sub-accounts and [Google does not allow changing a sub-account's country](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts#AccountAddress) we might need to modify this once the Google API behaviour is changed. Google API currently doesn't enforce this and allows modifying the country (even though it's not possible to do so via MC interface). Merchant Center API only accepts one address line and to adapt the WooCommerce address to it, the two addresses entered in WooCommerce settings are merged into one string separated with a new line character (`\n`). MC interface detects the addresses correctly and displays each in their own fields. Note that address components are returned in the API response as they appear on Google API. This means that their naming might be different from WooCommerce. For example, city is called `locality`, state is called `region`, etc. This is just for the sake of simplicity and can be modified if we want to keep things similar to WC core.
Only update the phone number if a value is set in the request params. If a null or empty value is set then remove the phone number from contact information. Rename the `MerchantVerification` service to `ContactInformation`.
…ionControllerTest.php Co-authored-by: Mik <mikkamp@users.noreply.github.com>
Add API endpoints to update and fetch contact information
Change MC setup flow to have four steps
Address #934 (comment) Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
…ading Handle all loading states within the `PhoneNumberCard` component
Fix a bug that calling `split()` on `null` value in the useStoreAddress hook
as well. Otherwise, for merchants that didn't set the store address at all, Settings page would throw and error and render empty. Addresses #938 (comment)
But none of CI checks were done (see #922), so it would be nice to check it here. |
Implements part of #863.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
This PR merges the
feature/contact-info
branch intotrunk
. The changes in the branch have been reviewed in other smaller PRs, so we don't really need to review them in detail here.(Merges changes for #863)
Changelog entry