Skip payment welcome screen for wc pay banner experiment

This commit is contained in:
Chi-Hsuan Huang 2022-05-17 16:57:08 +08:00
parent b524b82816
commit d4af17d3a3
1 changed files with 10 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
$settings =
array(
array(
'type' => 'title', // this is needed as <table> tag is generated by this element, even if it has no other content.
'type' => 'title', // this is needed as <table> tag is generated by this element, even if it has no other content.
),
array( 'type' => 'payment_gateways_banner' ), // React mount point for embedded banner slotfill.
array(
@ -189,8 +189,16 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
/* Translators: %s Payment gateway name. */
echo '<a class="button alignright" aria-label="' . esc_attr( sprintf( __( 'Manage the "%s" payment method', 'woocommerce' ), $method_title ) ) . '" href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) ) ) . '">' . esc_html__( 'Manage', 'woocommerce' ) . '</a>';
} else {
if (
'WooCommerce Payments' === $method_title &&
class_exists( 'WC_Payments_Account' )
) {
$setup_url = WC_Payments_Account::get_connect_url();
} else {
$setup_url = admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) );
}
/* Translators: %s Payment gateway name. */
echo '<a class="button alignright" aria-label="' . esc_attr( sprintf( __( 'Set up the "%s" payment method', 'woocommerce' ), $method_title ) ) . '" href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . strtolower( $gateway->id ) ) ) . '">' . esc_html__( 'Set up', 'woocommerce' ) . '</a>';
echo '<a class="button alignright" aria-label="' . esc_attr( sprintf( __( 'Set up the "%s" payment method', 'woocommerce' ), $method_title ) ) . '" href="' . esc_url( $setup_url ) . '">' . esc_html__( 'Set up', 'woocommerce' ) . '</a>';
}
break;
case 'status':