From 6b357bcfdc583a8cbd1635ef051174b5b43c8cde Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 10 Oct 2017 15:40:03 +0100 Subject: [PATCH] Updates the payment step copy and fixes margins --- assets/css/wc-setup.scss | 33 ++++++++++++++++--- assets/js/admin/wc-setup.js | 8 +++++ .../admin/class-wc-admin-setup-wizard.php | 9 +++-- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/assets/css/wc-setup.scss b/assets/css/wc-setup.scss index 85923bafcbb..1419c25089e 100644 --- a/assets/css/wc-setup.scss +++ b/assets/css/wc-setup.scss @@ -513,12 +513,27 @@ body { .wc-wizard-service-description { flex-grow: 1; padding: 0 1em; + + p { + margin-bottom: 0; + } + + .wc-wizard-service-settings { + margin-top: 1em; + } + + .wc-wizard-service-settings-description { + display: block; + font-style: italic; + color: #999; + } } .wc-wizard-service-enable { flex-basis: 0; min-width: 75px; text-align: center; + cursor: pointer; } .wc-wizard-service-toggle { @@ -974,7 +989,6 @@ p.jetpack-terms { .wc-wizard-service-setting-stripe_create_account { display: flex; align-items: flex-end; - margin-bottom: 0.75em; margin-top: 0.75em; .payment-checkbox-input { @@ -991,15 +1005,26 @@ p.jetpack-terms { } .wc-wizard-service-setting-stripe_email { - display: flex; + margin-top: 0.75em; label.stripe_email { - visibility: hidden; - width: 0; + position: absolute; + margin: -1px; + padding: 0; + height: 1px; + width: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + border: 0; } input.payment-email-input { margin-left: 1.5em; + margin-bottom: .5em; width: 100%; } + + .wc-wizard-service-settings-description { + margin-left: 1.5em; + } } diff --git a/assets/js/admin/wc-setup.js b/assets/js/admin/wc-setup.js index 404eb48099b..6da71b0bd3c 100644 --- a/assets/js/admin/wc-setup.js +++ b/assets/js/admin/wc-setup.js @@ -105,10 +105,18 @@ jQuery( function( $ ) { $( this ).closest( '.wc-wizard-service-settings' ) .find( 'input.payment-email-input' ) .prop( 'required', true ); + $( this ).closest( '.wc-wizard-service-settings' ) + .find( '.wc-wizard-service-setting-stripe_email' ) + .show(); } else { $( this ).closest( '.wc-wizard-service-settings' ) .find( 'input.payment-email-input' ) .prop( 'required', false ); + $( this ).closest( '.wc-wizard-service-settings' ) + .find( '.wc-wizard-service-setting-stripe_email' ) + .hide(); } } ); + + $( '.wc-wizard-services input#stripe_create_account' ).change(); } ); diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index aa99683597c..3abfa48680b 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -1019,6 +1019,7 @@ class WC_Admin_Setup_Wizard { /** * Simple array of "in cart" gateways to show in wizard. + * * @return array */ protected function get_wizard_in_cart_payment_gateways() { @@ -1027,7 +1028,7 @@ class WC_Admin_Setup_Wizard { $user_email = $this->get_current_user_email(); $stripe_description = '

' . sprintf( - __( 'Accept all major debit and credit cards from customers in 135+ countries on your site. Learn more.', 'woocommerce' ), + __( 'Accept all major debit & credit cards from customers in 135+ countries on your site. Learn more.', 'woocommerce' ), 'https://wordpress.org/plugins/woocommerce-gateway-stripe/' ) . '

'; $paypal_bt_description = '

' . sprintf( @@ -1048,7 +1049,7 @@ class WC_Admin_Setup_Wizard { 'repo-slug' => 'woocommerce-gateway-stripe', 'settings' => array( 'create_account' => array( - 'label' => __( 'Create an account for me using this email:', 'woocommerce' ), + 'label' => __( 'Create a new Stripe account for me', 'woocommerce' ), 'type' => 'checkbox', 'value' => 'yes', 'placeholder' => '', @@ -1059,6 +1060,7 @@ class WC_Admin_Setup_Wizard { 'type' => 'email', 'value' => $user_email, 'placeholder' => __( 'Stripe email address', 'woocommerce' ), + 'description' => __( "Enter your email address and we'll create an account for you. Powered by WooCommerce Services.", 'woocommerce' ), 'required' => true, ), ), @@ -1207,6 +1209,9 @@ class WC_Admin_Setup_Wizard { /> + + +