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(modal-checkout): custom coupon form #1629

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

miguelpeixe
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Requires #1602.

Implements a custom coupon form handling so it doesn't inherit Woo's default UI handling of the form. The custom handling is implemented by changing the class name of the form.

image image

How to test the changes in this Pull Request:

  1. Check out this branch and make sure you have coupons enabled and at least 1 enabled coupon code
  2. Go through the modal checkout flow through a Checkout Button block (make sure it's not a donation product, which has coupons disabled)
  3. Enter an invalid coupon code and confirm you get the error message as above and the input is focused
  4. Enter a valid coupon code and confirm the checkout is updated to include the discount
  5. Click to remove the coupon code in the order review table and confirm the coupon is removed and the coupon form input is focused

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?

@miguelpeixe miguelpeixe self-assigned this Dec 13, 2023
@miguelpeixe miguelpeixe requested a review from a team as a code owner December 13, 2023 14:10
@miguelpeixe miguelpeixe mentioned this pull request Dec 13, 2023
6 tasks
Base automatically changed from feat/modal-checkout-redesign to epic/ras-acc December 20, 2023 17:40
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.

:chefkiss:

Do you think it's ok to modify the class name and potentially lose support for other plugins customizations on this form? I think it's fine, just confirming

@miguelpeixe
Copy link
Member Author

Do you think it's ok to modify the class name and potentially lose support for other plugins customizations on this form? I think it's fine, just confirming

It's something to keep an eye out for. I'm not aware of plugins that replace the coupon behavior.

It's worth noting that the code that this takes inspiration from, to be as close to the original behavior as possible, is 9 years old and is not exactly "hookable" to be extended. We'd be using such a hook if there was any 😅 . So I'd say it's safe to assume it shouldn't conflict with anything.

@miguelpeixe miguelpeixe merged commit 5b47c04 into epic/ras-acc Dec 20, 2023
@miguelpeixe miguelpeixe deleted the feat/modal-checkout-custom-coupon-form branch December 20, 2023 17:56
@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