diff --git a/assets/css/wc-setup.scss b/assets/css/wc-setup.scss index fdd8a33aaec..be2fa4d2289 100644 --- a/assets/css/wc-setup.scss +++ b/assets/css/wc-setup.scss @@ -947,6 +947,27 @@ h3.jetpack-reasons { } } +.wc-setup .wc-setup-actions .plugin-install-info { + display: block; + font-style: italic; + color: #999; + font-size: 14px; + line-height: 1.5em; + margin: 5px 0; + + & > * { + display: block; + } + + a { + white-space: nowrap; + + &:not(:hover):not(:focus) { + color: inherit; + } + } +} + .location-prompt { color: #666; font-size: 13px; diff --git a/assets/js/admin/wc-setup.js b/assets/js/admin/wc-setup.js index 87416e53469..c5914db6269 100644 --- a/assets/js/admin/wc-setup.js +++ b/assets/js/admin/wc-setup.js @@ -176,4 +176,34 @@ jQuery( function( $ ) { var countryCode = $( this ).val(); $( 'select#currency_code' ).val( wc_setup_currencies[ countryCode ] ).change(); } ); + + $( '.wc-setup-content' ).on( 'change', '[data-plugins]', function() { + var pluginLinkBySlug = {}; + + function addPlugins( plugins ) { + if ( Array.isArray( plugins ) ) { + for ( var i in plugins ) { + var pluginLink = '' + plugins[ i ].name + ''; + pluginLinkBySlug[ plugins[ i ].slug ] = pluginLink; + } + } + } + + $( '.wc-wizard-service-enable input:checked' ).each( function() { + addPlugins( $( this ).data( 'plugins' ) ); + } ); + + // Render list of plugins. + if ( Object.keys( pluginLinkBySlug ).length ) { + var pluginLinks = []; + for ( var slug in pluginLinkBySlug ) { + pluginLinks.push( pluginLinkBySlug[ slug ] ); + } + + $( 'span.plugin-install-info' ).show(); + $( 'span.plugin-install-info-list' ).html( pluginLinks.join( ', ' ) ); + } else { + $( 'span.plugin-install-info' ).hide(); + } + } ).find( '[data-plugins]' ).change(); } ); diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index 5fa80ff7983..31dcf045738 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -1406,6 +1406,8 @@ class WC_Admin_Setup_Wizard { $should_enable_toggle = isset( $item_info['enabled'] ) && $item_info['enabled']; } + $plugins = isset( $item_info['repo-slug'] ) ? array( array( 'slug' => $item_info['repo-slug'], 'name' => $item_info['name'] ) ) : null; + ?>
  • @@ -1468,6 +1470,7 @@ class WC_Admin_Setup_Wizard { type="checkbox" name="wc-wizard-service--enabled" value="yes" + data-plugins="" />