-
Notifications
You must be signed in to change notification settings - Fork 21
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
Onboarding: Default stores to destination-based tax rates during onboarding #2491
Comments
@mikkamp do you have any insight into this questin?
|
We have other locations where we set a default in the schema. However if I recall correctly, the WP_REST_Request class doesn't automatically extract this default value. For the reports we used the function get_default_params. Once it's accepted as the default in the REST API request to
If we don't remove it, the setting will still be available after onboarding by going to Dashboard > Programs > Free listings > Edit, so for now we can leave it there until we decide to move some of those settings (there are suggestions for moving the shipping settings, but nothing finalized yet). |
Thanks! Eason had also pointed this out in #2490 so I think we're all good here. |
Closing this as completed since it was part of the 2.9 release. |
Part of #2458.
During the 2nd page of the onboarding process, we're hiding the setting that let's users configure the tax rates for the store (#2490). Therefore, we want to always default the tax rate to "destination" on initial setup. The user will be able to change this later, but it is not necessary to configure during onboarding.
Acceptance Criteria
gla_merchant_center
option in the database.Implementation Brief
When tax rates are changed, the frontend sends a REST API request to the
/wp-json/wc/gla/mc/settings
endpoint with updated values for the settings (including thetax_rate
setting. The controller for that API endpoint is located insrc/API/Site/Controllers/MerchantCenter/SettingsController.php
and uses a schema to define and validate the settings values used. We may be able to simply update this schemaSettingsController::get_schema_properties
to set a default value for thetax_rate
setting.After setting a default, we may still need to update the controller to pre-fill the default value, see #2491 (comment).
Test Coverage
Add new PHPUnit tests class for the
SettingsController
class in thetests/Unit/API/Site/Controllers/MerchantCenter/
folder. Include a test that ensures that when the settings are saved without passing atax_rate
that the return value will show thetax_rate
set to"destination"
(the default) and ensure that the underlying WP option is updated to include the default value.Definition Questions
The text was updated successfully, but these errors were encountered: