Prevent enabling Standard Card Button when ACDC is enabled (2803) #2404
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
"IMHO hiding the tab will be too confusing for users. Because when Create gateway for Standard Card Button is enabled but the tab simply doesn’t appear, users may consider the plugin to be broken.
It’s more complex but for best possible UX, I propose force-unchecking and greying out the
Enable Standard Card Button gateway
checkbox when ACDC is enabled while Create gateway for Standard Card Button is checked.It should also be impossible to enable this method from the Payments tab (it should automatically disable itself after trying to enable it with the toggle).
Additionally, a notice should be displayed on the PayPal Payments settings and on the Payments tab if the user checked the Create gateway for Standard Card Button setting while Advanced Card Processing is active.
So I think that in the context of this issue, it’s reasonable to refactor the notice class to handle this additional scenario: woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Notice/GatewayWithoutPayPalAdminNotice.php at fa76f1a73cdbdb21dd3b652ab460c03f68a3e766 · woocommerce/woocommerce-paypal-payments
Enable PayPal features for your store
is uncheckedClassic Checkout
location for smart buttons is disabledSo you can update the notice strings for the old scenario and give them the custom placement mentioned above (between the PayPal logo and our settings tabs).
About the notices, here is my string proposal to update the code in the existing place:
'%1$s cannot be used without the PayPal gateway. <a href="%2$s">Enable the PayPal gateway</a>.',
'%1$s cannot be used while PayPal features are disabled for your store. <a href="%2$s">Enable PayPal features for your store here</a>.',
admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway
'%1$s cannot be used without enabling the Checkout location for the PayPal gateway. <a href="%2$s">Enable the Checkout location</a>.',
'%1$s cannot be used without the Classic Checkout enabled in the Smart Button Locations. <a href="%2$s">Enable the Classic Checkout in the Smart Button Locations here</a>.'
admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway#field-button_style_heading
'The <a href="%1$s">Standard Card Button</a> cannot be used while <a href="%2$s">Advanced Card Processing</a> is enabled.',
%1$s = 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-card-button-gateway'
%2$s = 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway&ppcp-tab=ppcp-credit-card-gateway'
Steps to Test