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(ras-acc): support shipping, custom fields, and order notes in modal checkout #1626

Merged
merged 5 commits into from
Dec 20, 2023

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Dec 9, 2023

All Submissions:

Changes proposed in this Pull Request:

Adds support for conditionally showing the order summary for a shippable product only if shipping might incur additional fees on top of the of the order subtotal.

Also adds support for the new features introduced in Automattic/newspack-plugin#2800 to show different billing fields for donations vs. non-donation transactions, and to show order notes in either case.

How to test the changes in this Pull Request:

Check out this branch and Automattic/newspack-plugin#2800.

Conditional order summary

  1. In WooCommerce > Settings > Shipping, make sure you have an active shipping zone and that the shipping zone has two shipping methods: one should be "Free shipping" with no fees, and the other should be "Flat rate" with a shipping fee attached. Enable just "Free shipping" for now.
  2. Make sure you have a shippable product published. Assign the product to a Checkout Button block.
  3. As a new reader, purchase the shippable product via the Checkout Button block and proceed to the second modal screen (payment details). Confirm that no order summary is shown, because the "Free shipping" method is active.
  4. Back in settings, turn on the fee-based shipping method.
  5. Repeat step 3, but this time confirm the second modal screen contains an order summary showing an option to select a shipping method, and that updating the shipping method to the one that incurs will also update the order total:
Screenshot 2023-12-08 at 6 34 27 PM
  1. Back in settings, turn off "Free shipping" and repeat once more. This time confirm that the order summary is shown and that the shipping fee is automatically appended to the total (as it's now the only available shipping method).

Custom billing fields and order notes

See testing instructions in Automattic/newspack-plugin#2800.

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?

@dkoo dkoo marked this pull request as ready for review December 9, 2023 01:56
@dkoo dkoo requested a review from a team as a code owner December 9, 2023 01:56
@dkoo dkoo self-assigned this Dec 9, 2023
@dkoo
Copy link
Contributor Author

dkoo commented Dec 9, 2023

I'm not sure why the SCSS lint is failing...those lines are unchanged and also have /* stylelint-disable-line */. I would ignore this warning for now.

@dkoo dkoo mentioned this pull request Dec 9, 2023
6 tasks
@leogermani
Copy link
Contributor

leogermani commented Dec 13, 2023

It didn't quite work for me.

I set up the testing slightly different.

I have two shipping zones, each of them with only one method available

  • US -> flat rate
  • Brazil -> free shipping

When I set the shipping address to Brazil, I still see the summary with "Frete grátis" (free shipping" there.

image

When I set it to the US, I also see the summary, as expected.

EDIT: Apparently the method to retrieve the shipping methods return all shipping methods, and not only those related to the current shipping zone.

@dkoo
Copy link
Contributor Author

dkoo commented Dec 14, 2023

Ah, that's a good catch. a4ca300 fixes the logic so that it only considers shipping methods that apply to the current cart transaction.

@dkoo dkoo mentioned this pull request Dec 18, 2023
6 tasks
Base automatically changed from feat/modal-checkout-redesign to epic/ras-acc December 20, 2023 17:40
@dkoo dkoo merged commit 771b451 into epic/ras-acc Dec 20, 2023
@dkoo dkoo deleted the feat/shipping-and-custom-fields branch December 20, 2023 21:36
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.0.0-epic-ras-acc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.1.0-epic-ras-acc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.2.0-epic-ras-acc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.3.0-epic-ras-acc.1 🎉

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