-
Notifications
You must be signed in to change notification settings - Fork 69
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
Spike: Revisiting test mode badges on shortcode checkout #9819
Comments
Hey @Automattic/heisenberg - I’ve looked over this quite a bit this week and have pared this down to two possible solutions. I cut out any option listed above that relied on some sort of filter on the Happy to chime in on the discussion when I'm back from afk on the 7th, but feel free to discuss without me until then. Option 1: Pure client-side implementation
Option 2: Add new hook to the payment method template in WC core.
|
Cheers for the excellent exploration here, @brettshumaker! 🙌 So it appears we have a short-term client-side option available, which we estimate at around a sprint's worth of effort; and then a more comprehensive longer-term solution developed in WC Core that might require some additional buy-in and collaboration with the core checkout team. @pierorocca, would you mind dearly if I were to pick your brains to try to prioritise the optimal pathway to proceed here? First of all, it must be stated that this issue of test mode badges is already solved in blocks checkouts, so any effort expended here will only apply to the shortcode checkout. Would maintaining parity between our blocks and shortcodes offerings motivate us to implement a short-term solution or conversely might we be less eager to resolve this issue in the shortcode checkout, since withholding it adds value to the blocks product? With regards to our longer-term solution on core, the biggest vulnerability of this solution is that it is dependent on the WC core checkout template. Store owners would need to update WooCommerce on their site in order to encounter the test mode badges provided by our plugin and if stores use themes that override the core checkout template, then our changes would also not be visible. Would either of these hurdles be insurmountable blockers for this approach? In that case, the client-side solution may be the only option available to us. Essentially, we're trying to understand the general priority of restoring this feature on the shortcode checkout and how problematic some of the concerns around resolving this issue in core might be. 🙏 |
The ROI on this now appears to be quite low. Does this also impact the ability to dispaly the brand icons? If not what are the alternatives such as moving the badging out of the radio button? Thanks for the full context and sizing @FangedParakeet. |
Is that the problem we are solving in #9826? AFAIA, that is unrelated to the effort required here and this issue is not a blocker for that feature.
It's worth noting that in the existing blocks implementation, the test mode badge only appears when the relevant payment gateway is selected. Consequently, I think adding the test mode badge somewhere in the below area, in the payment gateway body on shortcode, would be a relatively lightweight lift--especially, if we decided to add the badge before the testing instructions; placing the badge alongside the payment information fields presented by Stripe might be less feasible. If we just wanted to enhance the testing instructions with the test mode badge for the shortcode checkout, I would expect this to be a |
Correct.
That's probably our best best. What does it look like with the badge inline with "Use test card" and on other payment methods on the first row, left aligned? |
Alternatively would something like this work on Shortcode checkout sites only @elizaan36? |
Description
Recently we added a new dynamic test mode badge to WooPayments payment gateways on both shortcode and blocks checkouts. Unfortunately, this implementation overrode the
get_title()
function of each relevant payment gateway, which had many unfortunate side-effects and even blocked the checkout from being completed for a subset of users using particular incompatible extensions. These changes were reverted from the shortcode checkout in #9800.We would like to return to resurrect this reverted functionality, but via a less intrusive implementation. We want to avoid overwriting the
get_title()
, since this function is relied upon in more places than simply the checkout where we intend this badge to be present, such as the errors produced in #9779. This will likely need to be a purely client-side, but the assignee is welcome to explore any other viable approaches. If there are multiple approaches, they can be compared in this issue prior to embarking on a full-fledged implementation.Edit: converting this issue into a spike, since there are multiple available approaches and we should discuss these approaches with the core WC team before deciding upon an optimal path.
Here are the available options that we discussed together:
get_title()
function specifically for checkout DOM in WC core.get_title()
to allow extensions to alter output.get_title()
function to add to DOM.Acceptance criteria
Dev notes
Note that these changes were reverted in #9800, which in turn reverted the following PRs, whose functionality should all be returned.
Additional context
The text was updated successfully, but these errors were encountered: