Added help tabs to main WC admin pages

This commit is contained in:
Mike Jolley 2012-01-18 11:53:34 +00:00
parent 41f35f172d
commit b3665c35b2
3 changed files with 84 additions and 2 deletions

View File

@ -25,8 +25,10 @@ if ( $typenow=='product' ) :
elseif ( $typenow=='shop_coupon' ) :
include_once('shop_coupon.php');
include_once('writepanels/writepanel-coupon_data.php');
add_action('load-edit.php', 'woocommerce_admin_help_tab');
elseif ( $typenow=='shop_order' ) :
include_once('shop_order.php');
include_once('writepanels/writepanel-order_data.php');
include_once('writepanels/writepanel-order_notes.php');
add_action('load-edit.php', 'woocommerce_admin_help_tab');
endif;

View File

@ -0,0 +1,68 @@
<?php
/**
* Functions used for the showing help/links to WooCommerce resources in admin
*
* @author WooThemes
* @category Admin
* @package WooCommerce
*/
/**
* Help Tab Content
*
* Shows some text about WooCommerce and links to docs.
*/
function woocommerce_admin_help_tab_content() {
$screen = get_current_screen();
$screen->add_help_tab( array(
'id' => 'woocommerce_overview_tab',
'title' => __('Settings', 'woocommerce'),
'content' =>
'<p>' . __( 'Welcome to WooCommerce Admin. Here you can set up your store and customise it to fit your needs. The sections available from the settings page include:', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'General', 'woocommerce' ) . '</strong> - ' . __( 'General settings such as your shop base, currency, and script/styling options which affect features used in your store.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Pages', 'woocommerce' ) . '</strong> - ' . __( 'This is where important store page are defined. You can also set up other pages (such as a Terms page) here.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Catalog', 'woocommerce' ) . '</strong> - ' . __( 'Options for how things like price, images and weights appear in your product catalog.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Inventory', 'woocommerce' ) . '</strong> - ' . __( 'Options concerning stock and stock notices.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Tax', 'woocommerce' ) . '</strong> - ' . __( 'Options concerning tax, including international and local tax rates.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Shipping', 'woocommerce' ) . '</strong> - ' . __( 'This is where shipping options are defined, and shipping methods are set up.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Payment Methods', 'woocommerce' ) . '</strong> - ' . __( 'This is where payment gateway options are defined, and individual payment gateways are set up.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Emails', 'woocommerce' ) . '</strong> - ' . __( 'Here you can customise the way WooCommerce emails appear.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Integration', 'woocommerce' ) . '</strong> - ' . __( 'The integration section contains options for third party services which integrate with WooCommerce.', 'woocommerce' ) . '</p>'
) );
$screen->add_help_tab( array(
'id' => 'woocommerce_overview_tab_2',
'title' => __('Reports', 'woocommerce'),
'content' =>
'<p>' . __( 'The reports section can be accessed from the left-hand navigation menu. Here you can generate reports for sales and customers.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Sales', 'woocommerce' ) . '</strong> - ' . __( 'Reports for sales based on date, top sellers and top earners.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Customers', 'woocommerce' ) . '</strong> - ' . __( 'Customer reports, such as signups per day.', 'woocommerce' ) . '</p>' .
'<p><strong>' . __( 'Stock', 'woocommerce' ) . '</strong> - ' . __( 'Stock reports for low sotck and out of stock items.', 'woocommerce' ) . '</p>'
) );
$screen->add_help_tab( array(
'id' => 'woocommerce_overview_tab_3',
'title' => __('Orders', 'woocommerce'),
'content' =>
'<p>' . __( 'The orders section can be accessed from the left-hand navigation menu. Here you can view and manage customer orders.', 'woocommerce' ) . '</p>' .
'<p>' . __( 'Orders can also be added from this section if you want to set them up for a customer manually.', 'woocommerce' ) . '</p>'
) );
$screen->add_help_tab( array(
'id' => 'woocommerce_overview_tab_4',
'title' => __('Coupons', 'woocommerce'),
'content' =>
'<p>' . __( 'Coupons can be managed from this section. Once added, customers will be able to enter coupon codes on the cart/checkout page. If a customer uses a coupon code they will be viewable when viewing orders.', 'woocommerce' ) . '</p>'
) );
$screen->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://www.woothemes.com/woocommerce/" target="_blank">WooCommerce</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/extend/plugins/woocommerce/" target="_blank">Project on WordPress.org</a>') . '</p>' .
'<p>' . __('<a href="https://github.com/woothemes/woocommerce" target="_blank">Project on Github</a>') . '</p>' .
'<p>' . __('<a href="http://www.woothemes.com/woocommerce-codex/" target="_blank">WooCommerce Codex</a>') . '</p>' .
'<p>' . __('<a href="http://www.woothemes.com/extensions/woocommerce-extensions/" target="_blank">Official Extensions</a>') . '</p>' .
'<p>' . __('<a href="http://www.woothemes.com/themes/woocommerce-themes/" target="_blank">Offical Themes</a>') . '</p>'
);
}

View File

@ -21,11 +21,14 @@ function woocommerce_admin_menu() {
if ( current_user_can( 'manage_woocommerce' ) ) $menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator woocommerce' );
add_menu_page(__('WooCommerce', 'woocommerce'), __('WooCommerce', 'woocommerce'), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings_page', $woocommerce->plugin_url() . '/assets/images/icons/menu_icon_wc.png', 55);
$main_page = add_menu_page(__('WooCommerce', 'woocommerce'), __('WooCommerce', 'woocommerce'), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings_page', $woocommerce->plugin_url() . '/assets/images/icons/menu_icon_wc.png', 55);
add_submenu_page('woocommerce', __('WooCommerce Settings', 'woocommerce'), __('Settings', 'woocommerce') , 'manage_woocommerce', 'woocommerce', 'woocommerce_settings_page');
add_submenu_page('woocommerce', __('Reports', 'woocommerce'), __('Reports', 'woocommerce') , 'view_woocommerce_reports', 'woocommerce_reports', 'woocommerce_reports_page');
$reports_page = add_submenu_page('woocommerce', __('Reports', 'woocommerce'), __('Reports', 'woocommerce') , 'view_woocommerce_reports', 'woocommerce_reports', 'woocommerce_reports_page');
add_submenu_page('edit.php?post_type=product', __('Attributes', 'woocommerce'), __('Attributes', 'woocommerce'), 'manage_woocommerce_products', 'woocommerce_attributes', 'woocommerce_attributes_page');
add_action('load-'.$main_page, 'woocommerce_admin_help_tab');
add_action('load-'.$reports_page, 'woocommerce_admin_help_tab');
$print_css_on = array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_reports', 'product_page_woocommerce_attributes', 'edit-tags.php', 'edit.php', 'index.php', 'post-new.php', 'post.php' );
foreach ($print_css_on as $page) add_action( 'admin_print_styles-'. $page, 'woocommerce_admin_css' );
@ -88,6 +91,15 @@ function install_woocommerce() {
do_install_woocommerce();
}
/**
* Admin Help Tabs
*/
function woocommerce_admin_help_tab() {
include_once( 'woocommerce-admin-content.php' );
woocommerce_admin_help_tab_content();
}
/**
* Admin Scripts
*/