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

Add fourth MC Setup step value: 'store_requirements' #928

Merged
merged 4 commits into from
Aug 5, 2021

Conversation

layoutd
Copy link
Contributor

@layoutd layoutd commented Aug 2, 2021

Changes proposed in this Pull Request:

Goes with #927 .

This adds a fourth step value to the possible replies from GET /wc/gla/mc/step: store_requirements.

This value is returned when shipping rate, shipping time, tax rate and free shipping threshold values are all deemed to have been completed:

  • Tax rate: US isn't a target country, or the tax_rate setting isn't empty
  • Offers Free Shipping: not offered (offers_free_shipping is false), or offered and free_shipping_threshold set (can be 0, just not null)
  • Shipping Rate: shipping_rate setting set to manual OR one row in wp_gla_shipping_rates table for each target country
  • Shipping time: same as shipping rate

Detailed test instructions:

  1. Go through MC Onboarding steps
  2. After each step, make a GET /gla/mc/setup request and confirm that the step value is as expected
  3. For shipping at settings, try different configurations to confirm that the values are correct:
    • If Shipping Rate and Time set to "Set in MC": store_requirements
    • If Shipping Rate and Time set to manual, but no values added: shipping_and_taxes
    • If Shipping Rate and Time set to manual, with values: store_requirements
    • Store has US as target country, but no option selected for taxes: shipping_and_taxes
    • Store has US as target country, EITHER option selected for taxes: store_requirements
    • Store has free shipping for some orders selected, empty value for the threshold: shipping_and_taxes
    • Store has free shipping for some orders selected, any value for the threshold (including 0 🤷🏻 ): store_requirements

(Changelog added with frontend changes).

Changelog entry

@layoutd layoutd self-assigned this Aug 2, 2021
@layoutd layoutd requested a review from a team August 2, 2021 14:35
@layoutd layoutd changed the title Add fourth value for MC Setup step: 'store_requirements' Add fourth MC Setup step value: 'store_requirements' Aug 2, 2021
@layoutd layoutd changed the base branch from trunk to feature/contact-info August 3, 2021 07:01
eason9487 added a commit that referenced this pull request Aug 3, 2021
@jconroy
Copy link
Member

jconroy commented Aug 5, 2021

@eason9487 can you check if this works for you?

Copy link
Member

@eason9487 eason9487 left a comment

Choose a reason for hiding this comment

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

Apart from the PHP code that I can't evaluate, I tested this PR yesterday by changing the settings in step 3, and all logic works correctly.

Copy link
Contributor

@nima-karimi nima-karimi left a comment

Choose a reason for hiding this comment

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

Looks good overall, added two comments.

src/MerchantCenter/MerchantCenterService.php Outdated Show resolved Hide resolved
src/MerchantCenter/MerchantCenterService.php Outdated Show resolved Hide resolved
@layoutd layoutd merged commit c1f9aee into feature/contact-info Aug 5, 2021
@layoutd layoutd deleted the add/four-onboarding-steps branch August 5, 2021 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants