Merge pull request #17121 from woocommerce/update/wizard-payments-copy

Update payment step copy for Stripe, and fixes margins/spacing
This commit is contained in:
Mike Jolley 2017-10-11 10:17:57 +01:00 committed by GitHub
commit 12d93803ee
3 changed files with 44 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -122,10 +122,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();
} );

View File

@ -1022,6 +1022,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() {
@ -1030,7 +1031,7 @@ class WC_Admin_Setup_Wizard {
$user_email = $this->get_current_user_email();
$stripe_description = '<p>' . sprintf(
__( 'Accept all major debit and credit cards from customers in 135+ countries on your site. <a href="%s" target="_blank">Learn more</a>.', 'woocommerce' ),
__( 'Accept all major debit &amp; credit cards from customers in 135+ countries on your site. <a href="%s" target="_blank">Learn more</a>.', 'woocommerce' ),
'https://wordpress.org/plugins/woocommerce-gateway-stripe/'
) . '</p>';
$paypal_bt_description = '<p>' . sprintf(
@ -1051,7 +1052,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' => '',
@ -1062,6 +1063,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,
),
),
@ -1210,6 +1212,9 @@ class WC_Admin_Setup_Wizard {
<?php echo ( $setting['required'] ) ? 'required' : ''; ?>
<?php echo $is_checkbox ? checked( isset( $checked ) && $checked, true, false ) : ''; ?>
/>
<?php if ( ! empty( $setting['description'] ) ) : ?>
<span class="wc-wizard-service-settings-description"><?php echo esc_html( $setting['description'] ); ?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>