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 redesign tweaks #2805

Merged
merged 9 commits into from
Dec 20, 2023

Conversation

miguelpeixe
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Combines #2794 and #2771 for Automattic/newspack-blocks#1602.

2aaa84a skips reCAPTCHA when only performing form validation. There's no need for the extra API request if it's already performed while placing the order.

29ca892 moves the custom text for the order button to the main plugin's donation feature. It's best if the modal checkout, where it currently is, doesn't handle donation-specific tweaks.

Also changes how the initializer method registers hooks. I noticed all the hooks are registered inside a ! is_admin() condition, which doesn't seem like good practice. The origin of this is here #225 and the intention is to prevent the process_donation_form, hooked to wp_loaded from running in the admin. This check was moved to inside the process_donation_form, which is more appropriate for that purpose.

How to test the changes in this Pull Request:

Instructions at Automattic/newspack-blocks#1602

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 added the [Status] Needs Review The issue or pull request needs to be reviewed label Dec 12, 2023
@miguelpeixe miguelpeixe self-assigned this Dec 12, 2023
@miguelpeixe miguelpeixe requested a review from a team as a code owner December 12, 2023 14:07
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

Looking good! Very minor feedback below.

@miguelpeixe miguelpeixe requested a review from dkoo December 19, 2023 13:05
@miguelpeixe
Copy link
Member Author

Update: 6ff7dd0 tweaks the "cover fee" so it updates more instances in which the price is rendered. Fixes an issue when rendering the order review table: Automattic/newspack-blocks#1602 (review)

@miguelpeixe
Copy link
Member Author

The solution proposed in 6ff7dd0 doesn't work well. Every price is being contained in the newspack-wc-price class, so the result is this:

image

To properly implement the "cover fee" integrated with Woo's taxes or other features that may impact the final order price, the strategy for this might have to change. It's currently not working well in master either, so I think we should tackle it separately so it's no tied to this epic.

@miguelpeixe
Copy link
Member Author

More on the "cover fee". The design proposes adding a row to the table, which seems like a better approach which also seems to better integrate with how Woo does things:

image

cc @adekbadek

@miguelpeixe
Copy link
Member Author

miguelpeixe commented Dec 19, 2023

I started a draft here to refactor the cover fee approach to use Woo's WC()->cart->add_fee(). This should be tackled outside of the RAS-ACC project since it's affecting live sites.

Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

I started a draft here to refactor the cover fee approach to use Woo's WC()->cart->add_fee(). This should be tackled outside of the RAS-ACC project since it's affecting live sites.

Sounds good! In that case this looks good.

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Dec 19, 2023
@miguelpeixe miguelpeixe merged commit 535aa8b into epic/ras-acc Dec 20, 2023
@miguelpeixe miguelpeixe deleted the feat/ras-acc-modal-checkout-tweaks 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 GitHub release

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 GitHub release

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 GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @epic/ras-acc [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants