Add payment step service settings plugins to list

This commit is contained in:
Paul Dechov 2018-05-02 17:00:29 -04:00
parent 9b524d7d77
commit 57ad34451b
2 changed files with 13 additions and 0 deletions

View File

@ -191,6 +191,9 @@ jQuery( function( $ ) {
$( '.wc-wizard-service-enable input:checked' ).each( function() { $( '.wc-wizard-service-enable input:checked' ).each( function() {
addPlugins( $( this ).data( 'plugins' ) ); addPlugins( $( this ).data( 'plugins' ) );
$( this ).closest( '.wc-wizard-service-item' ).find( 'input.payment-checkbox-input:checked' ).each( function() {
addPlugins( $( this ).data( 'plugins' ) );
} );
} ); } );
// Render list of plugins. // Render list of plugins.

View File

@ -691,6 +691,13 @@ class WC_Admin_Setup_Wizard {
); );
} }
protected function get_wcs_requisite_plugins() {
return array(
array( 'name' => __( 'WooCommerce Services', 'woocommerce' ), 'slug' => 'woocommerce-services' ),
array( 'name' => __( 'Jetpack', 'woocommerce' ), 'slug' => 'jetpack' ),
);
}
/** /**
* Get the WCS shipping carrier for a given country code. * Get the WCS shipping carrier for a given country code.
* *
@ -1193,6 +1200,7 @@ class WC_Admin_Setup_Wizard {
'value' => 'yes', 'value' => 'yes',
'placeholder' => '', 'placeholder' => '',
'required' => false, 'required' => false,
'plugins' => $this->get_wcs_requisite_plugins(),
), ),
'email' => array( 'email' => array(
'label' => __( 'Stripe email address:', 'woocommerce' ), 'label' => __( 'Stripe email address:', 'woocommerce' ),
@ -1218,6 +1226,7 @@ class WC_Admin_Setup_Wizard {
'value' => 'yes', 'value' => 'yes',
'placeholder' => '', 'placeholder' => '',
'required' => false, 'required' => false,
'plugins' => $this->get_wcs_requisite_plugins(),
), ),
'email' => array( 'email' => array(
'label' => __( 'Direct payments to email address:', 'woocommerce' ), 'label' => __( 'Direct payments to email address:', 'woocommerce' ),
@ -1454,6 +1463,7 @@ class WC_Admin_Setup_Wizard {
placeholder="<?php echo esc_attr( $setting['placeholder'] ); ?>" placeholder="<?php echo esc_attr( $setting['placeholder'] ); ?>"
<?php echo ( $setting['required'] ) ? 'required' : ''; ?> <?php echo ( $setting['required'] ) ? 'required' : ''; ?>
<?php echo $is_checkbox ? checked( isset( $checked ) && $checked, true, false ) : ''; ?> <?php echo $is_checkbox ? checked( isset( $checked ) && $checked, true, false ) : ''; ?>
data-plugins="<?php echo esc_attr( json_encode( isset( $setting['plugins'] ) ? $setting['plugins'] : null ) ); ?>"
/> />
<?php if ( ! empty( $setting['description'] ) ) : ?> <?php if ( ! empty( $setting['description'] ) ) : ?>
<span class="wc-wizard-service-settings-description"><?php echo esc_html( $setting['description'] ); ?></span> <span class="wc-wizard-service-settings-description"><?php echo esc_html( $setting['description'] ); ?></span>