Spike: Revisiting test mode badges on shortcode checkout #9819
Labels
category: refactor
The issue/PR is related to refactoring.
focus: checkout payments
type: enhancement
The issue is a request for an enhancement.
type: spike
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: