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

Prevent Additional Checkout Fields values being shown on shortcode order confirmation #47333

Merged
merged 4 commits into from May 22, 2024

Conversation

opr
Copy link
Contributor

@opr opr commented May 9, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

When using the shortcode checkout, no fields added by the Additional Checkout Fields API are shown, which is the intended behaviour, but because we show "No" for unchecked checkboxes on the order confirmation screen, it appeared like the user had intentionally selected that during checkout despite the field not being present on the front end.

This PR checks the source of the order before determining what fields to show. If it was not made via the Store API then no fields will be shown.

Closes #47265 .

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Install the https://github.com/woocommerce/additional-checkout-fields-tester plugin ((https://github.com/woocommerce/woocommerce/files/15265418/additional-checkout-fields-tester-main.5.zip))
  2. Add an item to your cart and go to the Checkout block - ensure the additional fields show up (as per the readme of the above repository).
  3. Fill in the form, ensuring all fields are filled, and check out.
  4. Ensure the order confirmation contains the values of the additional field.
  5. Check the email sent to the shopper and the merchant and ensure both have the fields.
  6. Check the order in the WooCommerce dashboard, ensure the fields are there.
  7. Add an item to your cart and check out using the shortcode checkout experience.
  8. Ensure the fields don't show, then check out.
  9. Ensure the order confirmation contains the values of the additional field.
  10. Check the email sent to the shopper and the merchant and ensure neither show any of the fields.
  11. Check the order in the WooCommerce dashboard, ensure the fields are not there.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label May 9, 2024
@opr opr self-assigned this May 9, 2024
Copy link
Contributor

github-actions bot commented May 9, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

@opr opr force-pushed the fix/additional-checkbox-shortcodes branch from f6189c4 to ecd48dc Compare May 20, 2024 16:12
@opr opr marked this pull request as ready for review May 20, 2024 17:16
@woocommercebot woocommercebot requested review from a team and alexflorisca and removed request for a team May 20, 2024 17:16
Copy link
Contributor

Hi @alexflorisca,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Member

@alexflorisca alexflorisca left a comment

Choose a reason for hiding this comment

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

Nice work, it all tests out ok

@opr opr merged commit 845bdae into trunk May 22, 2024
35 checks passed
@opr opr deleted the fix/additional-checkbox-shortcodes branch May 22, 2024 13:07
@github-actions github-actions bot added this to the 9.0.0 milestone May 22, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label May 22, 2024
@Stojdza Stojdza added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Orders placed using the shortcode checkout include "No" values from Additional Checkout Fields checkboxes
3 participants