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

feat: display purchase details in checkout modal when taxes are enabled #1480

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

laurelfulford
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds the tax/order details table on the second screen of the modal checkout, if you have taxes enabled.

It also removes some cruft that came over from the theme's version of this template; the theme had options to hide this information outright, display it with a toggle, or show it all the time. We could also go that route; I was just leery of duplicating the setting, or tying it to something in the current theme if we can avoid it 😬

I also didn't do much with the styling; I tried to keep with the simplified appearance for this information, but it just felt more cluttered. The table's a straight copy of how this information displays in the theme.

See 1200550061930446-as-1204773493453836

How to test the changes in this Pull Request:

First enable and set up taxes.

  1. Enable taxes in WooCommerce by following these steps. You want your prices to be exclusive of tax (so they're added at checkout).
  2. When you get to Shipping Tax Class, you only need the 'Standard Rate'.
  3. Add some Tax Rates by clicking WooCommerce > Settings > Tax > Standard Rate; you can import this CSV for the tax rates for the different Canadian provinces/territories, or add your own.
  4. Under WooCommerce > Settings > Taxes, set taxes to be applied from the Shop location, and make sure your shop address matches a location you've set some taxes for.

image

Next, test the PR:

  1. Apply the PR and run npm run build.
  2. Set up a page with a checkout button linked to a product.
  3. Click the button, and fill in your billing details; click Continue.
  4. On the next screen, you should get a table of billing details under the simplified total that includes your taxes (my shop is set in BC, so it's charging both GST and PST):

image

  1. Disable taxes under WooCommerce > Settings > Genera.
  2. Repeat steps 3-4, and confirm the table no longer displays.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Contributor

@leogermani leogermani left a comment

Choose a reason for hiding this comment

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

Works as described and fits well in the modal.

Maybe we can investigate in the future if we have more granular control on what to display to make it less verbose?

@laurelfulford
Copy link
Contributor Author

Thanks @leogermani! 🙌

@laurelfulford laurelfulford merged commit b69f8f3 into master Jun 21, 2023
@laurelfulford laurelfulford deleted the feat/optionally-display-details-in-modal branch June 21, 2023 18:12
matticbot pushed a commit that referenced this pull request Jun 22, 2023
# [1.71.0-alpha.1](v1.70.0...v1.71.0-alpha.1) (2023-06-22)

### Bug Fixes

* **donate-block:** allow spaces in button label ([#1479](#1479)) ([96adc82](96adc82))

### Features

* display purchase details in checkout modal when taxes are enabled ([#1480](#1480)) ([b69f8f3](b69f8f3))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.71.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jun 29, 2023
# [1.72.0-alpha.1](v1.71.0...v1.72.0-alpha.1) (2023-06-29)

### Bug Fixes

* **donate-block:** allow spaces in button label ([#1479](#1479)) ([96adc82](96adc82))

### Features

* display purchase details in checkout modal when taxes are enabled ([#1480](#1480)) ([b69f8f3](b69f8f3))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.72.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jul 3, 2023
# [1.72.0](v1.71.0...v1.72.0) (2023-07-03)

### Bug Fixes

* **donate-block:** allow spaces in button label ([#1479](#1479)) ([96adc82](96adc82))

### Features

* display purchase details in checkout modal when taxes are enabled ([#1480](#1480)) ([b69f8f3](b69f8f3))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.72.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants