render suggestions containers (& unstyled suggestions) in orders list

This commit is contained in:
haszari 2019-02-22 16:13:37 +13:00
parent 24bbb9267e
commit 4e42021578
2 changed files with 14 additions and 0 deletions

View File

@ -47,8 +47,12 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
*/
protected function render_blank_state() {
echo '<div class="woocommerce-BlankState">';
echo '<h2 class="woocommerce-BlankState-message">' . esc_html__( 'When you receive a new order, it will appear here.', 'woocommerce' ) . '</h2>';
echo '<a class="woocommerce-BlankState-cta button-primary button" target="_blank" href="https://docs.woocommerce.com/document/managing-orders/?utm_source=blankslate&utm_medium=product&utm_content=ordersdoc&utm_campaign=woocommerceplugin">' . esc_html__( 'Learn more about orders', 'woocommerce' ) . '</a>';
do_action( 'wc_marketplace_suggestions_orders_empty_state' );
echo '</div>';
}

View File

@ -29,6 +29,7 @@ class WC_Marketplace_Suggestions {
// Register hooks for rendering suggestions container markup.
add_action( 'wc_marketplace_suggestions_products_empty_state', array( __CLASS__, 'render_products_list_empty_state' ) );
add_action( 'wc_marketplace_suggestions_orders_empty_state', array( __CLASS__, 'render_orders_list_empty_state' ) );
}
/**
@ -87,6 +88,15 @@ class WC_Marketplace_Suggestions {
self::render_suggestions_container( 'products-list-empty-footer' );
}
/**
* Render suggestions containers in orders list empty state.
*/
public static function render_orders_list_empty_state() {
self::render_suggestions_container( 'orders-list-empty-header' );
self::render_suggestions_container( 'orders-list-empty-body' );
self::render_suggestions_container( 'orders-list-empty-footer' );
}
/**
* Render a suggestions container element, with the specified context.
*