diff --git a/admin/woocommerce-admin-functions.php b/admin/woocommerce-admin-functions.php index f82ed1ed15a..c56fa584f88 100644 --- a/admin/woocommerce-admin-functions.php +++ b/admin/woocommerce-admin-functions.php @@ -104,30 +104,6 @@ function woocommerce_prevent_admin_access() { endif; } -/** - * Redirect to settings after installation - */ -function install_woocommerce_redirect() { - global $pagenow, $woocommerce; - - if ( is_admin() && isset( $_GET['activate'] ) && ($_GET['activate'] == true) && $pagenow == 'plugins.php' && get_option( "woocommerce_installed" ) == 1 ) : - - // Clear transient cache - $woocommerce->clear_product_transients(); - - // Unset installed flag - update_option( "woocommerce_installed", 0 ); - - // Flush rewrites - flush_rewrite_rules( false ); - - // Redirect to settings - wp_redirect(admin_url('admin.php?page=woocommerce&installed=true')); - exit; - - endif; -} - /** * Fix 'insert into post' buttons for images **/ diff --git a/admin/woocommerce-admin-init.php b/admin/woocommerce-admin-init.php index eee9ce65211..3ab2ab4e4db 100644 --- a/admin/woocommerce-admin-init.php +++ b/admin/woocommerce-admin-init.php @@ -34,6 +34,29 @@ function woocommerce_admin_menu() { foreach ($print_css_on as $page) add_action( 'admin_print_styles-'. $page, 'woocommerce_admin_css' ); } +/** + * Admin Notices + */ +add_action( "admin_print_styles", 'woocommerce_admin_notices_styles' ); + +function woocommerce_admin_notices() { + ?> +
+ 0 || isset($_GET['install_woocommerce_pages']) || isset($_GET['skip_install_woocommerce_pages'])) return; + + add_action( 'admin_notices', 'woocommerce_admin_notices' ); + wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/wc-activation.css', dirname( __FILE__ ) ) ); +} + + /** * Admin Includes - loaded conditionally */ @@ -82,8 +105,8 @@ function woocommerce_attributes_page() { */ function activate_woocommerce() { include_once( 'woocommerce-admin-install.php' ); - update_option( "woocommerce_installed", 1 ); update_option( 'skip_install_woocommerce_pages', 0 ); + update_option( 'woocommerce_installed', 1 ); do_install_woocommerce(); } function install_woocommerce() { diff --git a/admin/woocommerce-admin-install.php b/admin/woocommerce-admin-install.php index 691b3e4a578..84cbaf52493 100644 --- a/admin/woocommerce-admin-install.php +++ b/admin/woocommerce-admin-install.php @@ -45,6 +45,9 @@ function do_install_woocommerce() { // Update version update_option( "woocommerce_db_version", $woocommerce->version ); + + // Flush rewrites + flush_rewrite_rules( false ); } /** diff --git a/admin/woocommerce-admin-settings.php b/admin/woocommerce-admin-settings.php index 65ac9233675..f68ebeee78e 100644 --- a/admin/woocommerce-admin-settings.php +++ b/admin/woocommerce-admin-settings.php @@ -1048,6 +1048,7 @@ function woocommerce_settings() { // Add pages button if (isset($_GET['install_woocommerce_pages']) && $_GET['install_woocommerce_pages']) : + require_once( 'woocommerce-admin-install.php' ); woocommerce_create_pages(); update_option('skip_install_woocommerce_pages', 1); @@ -1060,32 +1061,19 @@ function woocommerce_settings() { $install_complete = true; // If we have just activated WooCommerce... - elseif (isset($_GET['installed']) && $_GET['installed']) : + elseif (get_option('woocommerce_installed')==1) : flush_rewrite_rules( false ); if (woocommerce_get_page_id('shop')>0) : $install_complete = true; - else : - $show_page_installer = true; endif; - // If we havn't just installed, but page installed has not been skipped and shop page does not exist... - elseif (!get_option('skip_install_woocommerce_pages') && !woocommerce_get_page_id('shop')) : - - $show_page_installer = true; - endif; - if ($show_page_installer) : - - echo '' . __( 'Welcome to WooCommerce!', 'woocommerce' ) . '
-'. __('WooCommerce requires several WordPress pages containing shortcodes in order to work correctly; these include Shop, Cart, Checkout and My Account. To add these pages automatically please click the \'Automatically add pages\' button below, otherwise you can set them up manually. See the \'Pages\' tab in settings for more information.', 'woocommerce') .'
-'. __('Automatically add pages', 'woocommerce') .' '. __('Skip setup', 'woocommerce') .'
-' . __( 'Like WooCommerce? Support us by leaving a rating!', 'woocommerce' ) . '
diff --git a/assets/css/wc-activation.css b/assets/css/wc-activation.css new file mode 100644 index 00000000000..188ccdeb0b2 --- /dev/null +++ b/assets/css/wc-activation.css @@ -0,0 +1,70 @@ +.woocommerce-message { + position: relative; + z-index: 100; + border: 1px solid #b76ca9 !important; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + -moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + overflow: hidden; + line-height: 180%; + padding: 10px 0 5px !important; + background: #cc99c2 url(../images/message.png) no-repeat right bottom !important; +} +.woocommerce-message .squeezer { + max-width: 940px; + margin: 0 0 2px; + padding: 0 10px; + text-align: left; + overflow: hidden; +} +.woocommerce-message h4 { + margin: 0 10px 10px 0; + font-size: 18px; + font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; + font-weight: normal; + color: #fff; + text-shadow: 0px 1px 1px #b574a8; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + display: inline-block; +} +.woocommerce-message p { + margin: -1px 0 0 0 !important; + padding: 0; + display: inline-block; +} +.woocommerce-message p a.button-primary { + font-size: 16px !important; + display: inline-block; + padding: 8px 15px; + color: #fff; + text-align: center; + text-decoration: none; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + border: 1px solid #88537e; + background: #a46497; + -moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); + -webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); + box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); + text-shadow: 0px -1px 0px rgba( 0,0,0,0.3); + -webkit-transition-duration: .3s; + -moz-transition-duration: .3s; + cursor: pointer; + font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; +} +.woocommerce-message p a.button-primary:hover, .woocommerce-message p a.button-primary:active { + background-color: #f0a000; + border-color: #c87800; + -webkit-transition-duration: .3s; + outline: none; + opacity: 1; +} +.woocommerce-message p a.skip { + opacity: 0.5; +} \ No newline at end of file diff --git a/assets/images/message.png b/assets/images/message.png new file mode 100644 index 00000000000..cbd7a9c3845 Binary files /dev/null and b/assets/images/message.png differ diff --git a/readme.txt b/readme.txt index ddd5dbfa67b..fa764426380 100644 --- a/readme.txt +++ b/readme.txt @@ -101,6 +101,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo * Quantity based on stock limit on cart page, like the product page * Fixed category widget hierarchy * Password error on checkout +* Improved install process = 1.4.2 - 09/02/2012 = * Uninstall fix