From 57ad34451b80cb202ea216e47780b357264cb305 Mon Sep 17 00:00:00 2001 From: Paul Dechov Date: Wed, 2 May 2018 17:00:29 -0400 Subject: [PATCH] Add payment step service settings plugins to list --- assets/js/admin/wc-setup.js | 3 +++ includes/admin/class-wc-admin-setup-wizard.php | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/assets/js/admin/wc-setup.js b/assets/js/admin/wc-setup.js index c5914db6269..6787c3a8a30 100644 --- a/assets/js/admin/wc-setup.js +++ b/assets/js/admin/wc-setup.js @@ -191,6 +191,9 @@ jQuery( function( $ ) { $( '.wc-wizard-service-enable input:checked' ).each( function() { 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. diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index 31dcf045738..2d6e89fe2d5 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -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. * @@ -1193,6 +1200,7 @@ class WC_Admin_Setup_Wizard { 'value' => 'yes', 'placeholder' => '', 'required' => false, + 'plugins' => $this->get_wcs_requisite_plugins(), ), 'email' => array( 'label' => __( 'Stripe email address:', 'woocommerce' ), @@ -1218,6 +1226,7 @@ class WC_Admin_Setup_Wizard { 'value' => 'yes', 'placeholder' => '', 'required' => false, + 'plugins' => $this->get_wcs_requisite_plugins(), ), 'email' => array( 'label' => __( 'Direct payments to email address:', 'woocommerce' ), @@ -1454,6 +1463,7 @@ class WC_Admin_Setup_Wizard { placeholder="" + data-plugins="" />