This commit is contained in:
KhaiNguyen
2020-02-13 10:39:37 +07:00
commit 59401cb805
12867 changed files with 4646216 additions and 0 deletions

View File

@@ -0,0 +1,129 @@
<?php
/**
* Admin View: Page - Addons
*
* @package WooCommerce/Admin
* @var string $view
* @var object $addons
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div class="wrap woocommerce wc_addons_wrap">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons' ) ); ?>" class="nav-tab nav-tab-active"><?php esc_html_e( 'Browse Extensions', 'woocommerce' ); ?></a>
<?php
$count_html = WC_Helper_Updater::get_updates_count_html();
// translators: Count of updates for WooCommerce.com subscriptions.
$menu_title = sprintf( __( 'WooCommerce.com Subscriptions %s', 'woocommerce' ), $count_html );
?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=helper' ) ); ?>" class="nav-tab"><?php echo wp_kses_post( $menu_title ); ?></a>
</nav>
<h1 class="screen-reader-text"><?php esc_html_e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
<?php if ( $sections ) : ?>
<ul class="subsubsub">
<?php foreach ( $sections as $section ) : ?>
<li>
<a
class="<?php echo $current_section === $section->slug ? 'current' : ''; ?>"
href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=' . esc_attr( $section->slug ) ) ); ?>">
<?php echo esc_html( $section->label ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php if ( isset( $_GET['search'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
<h1 class="search-form-title" >
<?php printf( esc_html__( 'Showing search results for: %s', 'woocommerce' ), '<strong>' . esc_html( sanitize_text_field( wp_unslash( $_GET['search'] ) ) ) . '</strong>' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
</h1>
<?php endif; ?>
<form class="search-form" method="GET">
<button type="submit">
<span class="dashicons dashicons-search"></span>
</button>
<input
type="text"
name="search"
value="<?php echo esc_attr( isset( $_GET['search'] ) ? sanitize_text_field( wp_unslash( $_GET['search'] ) ) : '' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"
placeholder="<?php esc_attr_e( 'Enter a search term and press enter', 'woocommerce' ); ?>">
<input type="hidden" name="page" value="wc-addons">
<?php $page_section = ( isset( $_GET['section'] ) && '_featured' !== $_GET['section'] ) ? sanitize_text_field( wp_unslash( $_GET['section'] ) ) : '_all'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
<input type="hidden" name="section" value="<?php echo esc_attr( $page_section ); ?>">
</form>
<?php if ( '_featured' === $current_section ) : ?>
<div class="addons-featured">
<?php
$featured = WC_Admin_Addons::get_featured();
?>
</div>
<?php endif; ?>
<?php if ( '_featured' !== $current_section && $addons ) : ?>
<?php if ( 'shipping_methods' === $current_section ) : ?>
<div class="addons-shipping-methods">
<?php WC_Admin_Addons::output_wcs_banner_block(); ?>
</div>
<?php endif; ?>
<ul class="products">
<?php foreach ( $addons as $addon ) : ?>
<?php
if ( 'shipping_methods' === $current_section ) {
// Do not show USPS or Canada Post extensions for US and CA stores, respectively.
$country = WC()->countries->get_base_country();
if ( 'US' === $country
&& false !== strpos(
$addon->link,
'woocommerce.com/products/usps-shipping-method'
)
) {
continue;
}
if ( 'CA' === $country
&& false !== strpos(
$addon->link,
'woocommerce.com/products/canada-post-shipping-method'
)
) {
continue;
}
}
?>
<li class="product">
<a href="<?php echo esc_attr( WC_Admin_Addons::add_in_app_purchase_url_params( $addon->link ) ); ?>">
<?php if ( ! empty( $addon->image ) ) : ?>
<span class="product-img-wrap"><img src="<?php echo esc_url( $addon->image ); ?>"/></span>
<?php else : ?>
<h2><?php echo esc_html( $addon->title ); ?></h2>
<?php endif; ?>
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
<p><?php echo wp_kses_post( $addon->excerpt ); ?></p>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php else : ?>
<?php /* translators: a url */ ?>
<p><?php printf( wp_kses_post( __( 'Our catalog of WooCommerce Extensions can be found on WooCommerce.com here: <a href="%s">WooCommerce Extensions Catalog</a>', 'woocommerce' ) ), 'https://woocommerce.com/product-category/woocommerce-extensions/' ); ?></p>
<?php endif; ?>
<?php if ( 'Storefront' !== $theme['Name'] && '_featured' !== $current_section ) : ?>
<div class="storefront">
<a href="<?php echo esc_url( 'https://woocommerce.com/storefront/' ); ?>" target="_blank"><img src="<?php echo esc_url( WC()->plugin_url() ); ?>/assets/images/storefront.png" alt="<?php esc_attr_e( 'Storefront', 'woocommerce' ); ?>" /></a>
<h2><?php esc_html_e( 'Looking for a WooCommerce theme?', 'woocommerce' ); ?></h2>
<p><?php echo wp_kses_post( __( 'We recommend Storefront, the <em>official</em> WooCommerce theme.', 'woocommerce' ) ); ?></p>
<p><?php echo wp_kses_post( __( 'Storefront is an intuitive, flexible and <strong>free</strong> WordPress theme offering deep integration with WooCommerce and many of the most popular customer-facing extensions.', 'woocommerce' ) ); ?></p>
<p>
<a href="https://woocommerce.com/storefront/" target="_blank" class="button"><?php esc_html_e( 'Read all about it', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-theme&theme=storefront' ), 'install-theme_storefront' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Download &amp; install', 'woocommerce' ); ?></a>
</p>
</div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,98 @@
<?php
/**
* Admin View: Product Export
*
* @package WooCommerce/Admin/Export
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
wp_enqueue_script( 'wc-product-export' );
$exporter = new WC_Product_CSV_Exporter();
?>
<div class="wrap woocommerce">
<h1><?php esc_html_e( 'Export Products', 'woocommerce' ); ?></h1>
<div class="woocommerce-exporter-wrapper">
<form class="woocommerce-exporter">
<header>
<span class="spinner is-active"></span>
<h2><?php esc_html_e( 'Export products to a CSV file', 'woocommerce' ); ?></h2>
<p><?php esc_html_e( 'This tool allows you to generate and download a CSV file containing a list of all products.', 'woocommerce' ); ?></p>
</header>
<section>
<table class="form-table woocommerce-exporter-options">
<tbody>
<tr>
<th scope="row">
<label for="woocommerce-exporter-columns"><?php esc_html_e( 'Which columns should be exported?', 'woocommerce' ); ?></label>
</th>
<td>
<select id="woocommerce-exporter-columns" class="woocommerce-exporter-columns wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all columns', 'woocommerce' ); ?>">
<?php
foreach ( $exporter->get_default_column_names() as $column_id => $column_name ) {
echo '<option value="' . esc_attr( $column_id ) . '">' . esc_html( $column_name ) . '</option>';
}
?>
<option value="downloads"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></option>
<option value="attributes"><?php esc_html_e( 'Attributes', 'woocommerce' ); ?></option>
</select>
</td>
</tr>
<tr>
<th scope="row">
<label for="woocommerce-exporter-types"><?php esc_html_e( 'Which product types should be exported?', 'woocommerce' ); ?></label>
</th>
<td>
<select id="woocommerce-exporter-types" class="woocommerce-exporter-types wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all products', 'woocommerce' ); ?>">
<?php
foreach ( wc_get_product_types() as $value => $label ) {
echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $label ) . '</option>';
}
?>
<option value="variation"><?php esc_html_e( 'Product variations', 'woocommerce' ); ?></option>
</select>
</td>
</tr>
<tr>
<th scope="row">
<label for="woocommerce-exporter-category"><?php esc_html_e( 'Which product category should be exported?', 'woocommerce' ); ?></label>
</th>
<td>
<select id="woocommerce-exporter-category" class="woocommerce-exporter-category wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all categories', 'woocommerce' ); ?>">
<?php
$categories = get_categories(
array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
)
);
foreach ( $categories as $category ) {
echo '<option value="' . esc_attr( $category->slug ) . '">' . esc_html( $category->name ) . '</option>';
}
?>
</td>
</tr>
<tr>
<th scope="row">
<label for="woocommerce-exporter-meta"><?php esc_html_e( 'Export custom meta?', 'woocommerce' ); ?></label>
</th>
<td>
<input type="checkbox" id="woocommerce-exporter-meta" value="1" />
<label for="woocommerce-exporter-meta"><?php esc_html_e( 'Yes, export all custom meta', 'woocommerce' ); ?></label>
</td>
</tr>
<?php do_action( 'woocommerce_product_export_row' ); ?>
</tbody>
</table>
<progress class="woocommerce-exporter-progress" max="100" value="0"></progress>
</section>
<div class="wc-actions">
<button type="submit" class="woocommerce-exporter-button button button-primary" value="<?php esc_attr_e( 'Generate CSV', 'woocommerce' ); ?>"><?php esc_html_e( 'Generate CSV', 'woocommerce' ); ?></button>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,73 @@
<?php
/**
* Admin View: Page - Reports
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div class="wrap woocommerce">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
foreach ( $reports as $key => $report_group ) {
echo '<a href="' . admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ) . '" class="nav-tab ';
if ( $current_tab == $key ) {
echo 'nav-tab-active';
}
echo '">' . esc_html( $report_group['title'] ) . '</a>';
}
do_action( 'wc_reports_tabs' );
?>
</nav>
<?php
if ( sizeof( $reports[ $current_tab ]['reports'] ) > 1 ) {
?>
<ul class="subsubsub">
<li>
<?php
$links = array();
foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
$link = '<a href="admin.php?page=wc-reports&tab=' . urlencode( $current_tab ) . '&amp;report=' . urlencode( $key ) . '" class="';
if ( $key == $current_report ) {
$link .= 'current';
}
$link .= '">' . $report['title'] . '</a>';
$links[] = $link;
}
echo implode( ' | </li><li>', $links );
?>
</li>
</ul>
<br class="clear" />
<?php
}
if ( isset( $reports[ $current_tab ]['reports'][ $current_report ] ) ) {
$report = $reports[ $current_tab ]['reports'][ $current_report ];
if ( ! isset( $report['hide_title'] ) || true != $report['hide_title'] ) {
echo '<h1>' . esc_html( $report['title'] ) . '</h1>';
} else {
echo '<h1 class="screen-reader-text">' . esc_html( $report['title'] ) . '</h1>';
}
if ( $report['description'] ) {
echo '<p>' . $report['description'] . '</p>';
}
if ( $report['callback'] && ( is_callable( $report['callback'] ) ) ) {
call_user_func( $report['callback'], $current_report );
}
}
?>
</div>

View File

@@ -0,0 +1,31 @@
<?php
/**
* Admin View: Page - Status Database Logs
*
* @package WooCommerce/Admin/Logs
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<form method="post" id="mainform" action="">
<?php $log_table_list->search_box( __( 'Search logs', 'woocommerce' ), 'log' ); ?>
<?php $log_table_list->display(); ?>
<input type="hidden" name="page" value="wc-status" />
<input type="hidden" name="tab" value="logs" />
<?php submit_button( __( 'Flush all logs', 'woocommerce' ), 'delete', 'flush-logs' ); ?>
<?php wp_nonce_field( 'woocommerce-status-logs' ); ?>
</form>
<?php
wc_enqueue_js(
"jQuery( '#flush-logs' ).click( function() {
if ( window.confirm('" . esc_js( __( 'Are you sure you want to clear all logs from the database?', 'woocommerce' ) ) . "') ) {
return true;
}
return false;
});"
);

View File

@@ -0,0 +1,45 @@
<?php
/**
* Admin View: Page - Status Logs
*
* @package WooCommerce/Admin/Logs
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<?php if ( $logs ) : ?>
<div id="log-viewer-select">
<div class="alignleft">
<h2>
<?php echo esc_html( $viewed_log ); ?>
<?php if ( ! empty( $viewed_log ) ) : ?>
<a class="page-title-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => sanitize_title( $viewed_log ) ), admin_url( 'admin.php?page=wc-status&tab=logs' ) ), 'remove_log' ) ); ?>" class="button"><?php esc_html_e( 'Delete log', 'woocommerce' ); ?></a>
<?php endif; ?>
</h2>
</div>
<div class="alignright">
<form action="<?php echo esc_url( admin_url( 'admin.php?page=wc-status&tab=logs' ) ); ?>" method="post">
<select name="log_file">
<?php foreach ( $logs as $log_key => $log_file ) : ?>
<?php
$timestamp = filemtime( WC_LOG_DIR . $log_file );
/* translators: 1: last access date 2: last access time */
$date = sprintf( __( '%1$s at %2$s', 'woocommerce' ), date_i18n( wc_date_format(), $timestamp ), date_i18n( wc_time_format(), $timestamp ) );
?>
<option value="<?php echo esc_attr( $log_key ); ?>" <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>><?php echo esc_html( $log_file ); ?> (<?php echo esc_html( $date ); ?>)</option>
<?php endforeach; ?>
</select>
<button type="submit" class="button" value="<?php esc_attr_e( 'View', 'woocommerce' ); ?>"><?php esc_html_e( 'View', 'woocommerce' ); ?></button>
</form>
</div>
<div class="clear"></div>
</div>
<div id="log-viewer">
<pre><?php echo esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></pre>
</div>
<?php else : ?>
<div class="updated woocommerce-message inline"><p><?php esc_html_e( 'There are currently no logs to view.', 'woocommerce' ); ?></p></div>
<?php endif; ?>

View File

@@ -0,0 +1,28 @@
<?php
/**
* Admin View: Page - Status Tools
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<form method="post" action="options.php">
<?php settings_fields( 'woocommerce_status_settings_fields' ); ?>
<table class="wc_status_table wc_status_table--tools widefat" cellspacing="0">
<tbody class="tools">
<?php foreach ( $tools as $action => $tool ) : ?>
<tr class="<?php echo sanitize_html_class( $action ); ?>">
<th>
<strong class="name"><?php echo esc_html( $tool['name'] ); ?></strong>
<p class="description"><?php echo wp_kses_post( $tool['desc'] ); ?></p>
</th>
<td class="run-tool">
<a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wc-status&tab=tools&action=' . $action ), 'debug_action' ); ?>" class="button button-large <?php echo esc_attr( $action ); ?>"><?php echo esc_html( $tool['button'] ); ?></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</form>

View File

@@ -0,0 +1,48 @@
<?php
/**
* Admin View: Page - Status
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$current_tab = ! empty( $_REQUEST['tab'] ) ? sanitize_title( $_REQUEST['tab'] ) : 'status';
$tabs = array(
'status' => __( 'System status', 'woocommerce' ),
'tools' => __( 'Tools', 'woocommerce' ),
'logs' => __( 'Logs', 'woocommerce' ),
);
$tabs = apply_filters( 'woocommerce_admin_status_tabs', $tabs );
?>
<div class="wrap woocommerce">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
foreach ( $tabs as $name => $label ) {
echo '<a href="' . admin_url( 'admin.php?page=wc-status&tab=' . $name ) . '" class="nav-tab ';
if ( $current_tab == $name ) {
echo 'nav-tab-active';
}
echo '">' . $label . '</a>';
}
?>
</nav>
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
<?php
switch ( $current_tab ) {
case 'tools':
WC_Admin_Status::status_tools();
break;
case 'logs':
WC_Admin_Status::status_logs();
break;
default:
if ( array_key_exists( $current_tab, $tabs ) && has_action( 'woocommerce_admin_status_content_' . $current_tab ) ) {
do_action( 'woocommerce_admin_status_content_' . $current_tab );
} else {
WC_Admin_Status::status_report();
}
break;
}
?>
</div>

View File

@@ -0,0 +1,51 @@
<?php
/**
* Admin View: Settings
*
* @package WooCommerce
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'woocommerce_sections_' . $current_tab ) || has_action( 'woocommerce_settings_' . $current_tab ) || has_action( 'woocommerce_settings_tabs_' . $current_tab );
$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
if ( ! $tab_exists ) {
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings' ) );
exit;
}
?>
<div class="wrap woocommerce">
<?php do_action( 'woocommerce_before_settings_' . $current_tab ); ?>
<form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
foreach ( $tabs as $slug => $label ) {
echo '<a href="' . esc_html( admin_url( 'admin.php?page=wc-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
}
do_action( 'woocommerce_settings_tabs' );
?>
</nav>
<h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1>
<?php
do_action( 'woocommerce_sections_' . $current_tab );
self::show_messages();
do_action( 'woocommerce_settings_' . $current_tab );
do_action( 'woocommerce_settings_tabs_' . $current_tab ); // @deprecated hook. @todo remove in 4.0.
?>
<p class="submit">
<?php if ( empty( $GLOBALS['hide_save_button'] ) ) : ?>
<button name="save" class="button-primary woocommerce-save-button" type="submit" value="<?php esc_attr_e( 'Save changes', 'woocommerce' ); ?>"><?php esc_html_e( 'Save changes', 'woocommerce' ); ?></button>
<?php endif; ?>
<?php wp_nonce_field( 'woocommerce-settings' ); ?>
</p>
</form>
<?php do_action( 'woocommerce_after_settings_' . $current_tab ); ?>
</div>

View File

@@ -0,0 +1,315 @@
<?php
/**
* Admin View: Bulk Edit Products
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<fieldset class="inline-edit-col-right">
<div id="woocommerce-fields-bulk" class="inline-edit-col">
<h4><?php _e( 'Product data', 'woocommerce' ); ?></h4>
<?php do_action( 'woocommerce_product_bulk_edit_start' ); ?>
<div class="inline-edit-group">
<label class="alignleft">
<span class="title"><?php _e( 'Price', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="change_regular_price change_to" name="change_regular_price">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase existing price by (fixed amount or %):', 'woocommerce' ),
'3' => __( 'Decrease existing price by (fixed amount or %):', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label class="change-input">
<input type="text" name="_regular_price" class="text regular_price" placeholder="<?php printf( esc_attr__( 'Enter price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />
</label>
</div>
<div class="inline-edit-group">
<label class="alignleft">
<span class="title"><?php _e( 'Sale', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="change_sale_price change_to" name="change_sale_price">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase existing sale price by (fixed amount or %):', 'woocommerce' ),
'3' => __( 'Decrease existing sale price by (fixed amount or %):', 'woocommerce' ),
'4' => __( 'Set to regular price decreased by (fixed amount or %):', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label class="change-input">
<input type="text" name="_sale_price" class="text sale_price" placeholder="<?php printf( esc_attr__( 'Enter sale price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?>" value="" />
</label>
</div>
<?php if ( wc_tax_enabled() ) : ?>
<label>
<span class="title"><?php _e( 'Tax status', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="tax_status" name="_tax_status">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label>
<span class="title"><?php _e( 'Tax class', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="tax_class" name="_tax_class">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'standard' => __( 'Standard', 'woocommerce' ),
);
$tax_classes = WC_Tax::get_tax_classes();
if ( ! empty( $tax_classes ) ) {
foreach ( $tax_classes as $class ) {
$options[ sanitize_title( $class ) ] = esc_html( $class );
}
}
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<?php endif; ?>
<?php if ( wc_product_weight_enabled() ) : ?>
<div class="inline-edit-group">
<label class="alignleft">
<span class="title"><?php _e( 'Weight', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="change_weight change_to" name="change_weight">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label class="change-input">
<input type="text" name="_weight" class="text weight" placeholder="<?php printf( esc_attr__( '%1$s (%2$s)', 'woocommerce' ), wc_format_localized_decimal( 0 ), get_option( 'woocommerce_weight_unit' ) ); ?>" value="">
</label>
</div>
<?php endif; ?>
<?php if ( wc_product_dimensions_enabled() ) : ?>
<div class="inline-edit-group dimensions">
<label class="alignleft">
<span class="title"><?php _e( 'L/W/H', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="change_dimensions change_to" name="change_dimensions">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label class="change-input">
<input type="text" name="_length" class="text length" placeholder="<?php printf( esc_attr__( 'Length (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
<input type="text" name="_width" class="text width" placeholder="<?php printf( esc_attr__( 'Width (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
<input type="text" name="_height" class="text height" placeholder="<?php printf( esc_attr__( 'Height (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?>" value="">
</label>
</div>
<?php endif; ?>
<label>
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="shipping_class" name="_shipping_class">
<option value=""><?php _e( '— No change —', 'woocommerce' ); ?></option>
<option value="_no_shipping_class"><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
<?php
foreach ( $shipping_class as $key => $value ) {
echo '<option value="' . esc_attr( $value->slug ) . '">' . $value->name . '</option>';
}
?>
</select>
</span>
</label>
<label>
<span class="title"><?php _e( 'Visibility', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="visibility" name="_visibility">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label>
<span class="title"><?php _e( 'Featured', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="featured" name="_featured">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label>
<span class="title"><?php _e( 'In stock?', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="stock_status" name="_stock_status">
<?php
echo '<option value="">' . esc_html__( '— No Change —', 'woocommerce' ) . '</option>';
foreach ( wc_get_product_stock_status_options() as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<?php if ( 'yes' == get_option( 'woocommerce_manage_stock' ) ) : ?>
<label>
<span class="title"><?php _e( 'Manage stock?', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="manage_stock" name="_manage_stock">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<div class="inline-edit-group">
<label class="alignleft stock_qty_field">
<span class="title"><?php _e( 'Stock qty', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="change_stock change_to" name="change_stock">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase existing stock by:', 'woocommerce' ),
'3' => __( 'Decrease existing stock by:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<label class="change-input">
<input type="text" name="_stock" class="text stock" placeholder="<?php esc_attr_e( 'Stock qty', 'woocommerce' ); ?>" step="any" value="">
</label>
</div>
<label>
<span class="title"><?php _e( 'Backorders?', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="backorders" name="_backorders">
<?php
echo '<option value="">' . esc_html__( '— No Change —', 'woocommerce' ) . '</option>';
foreach ( wc_get_product_backorder_options() as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
</select>
</span>
</label>
<?php endif; ?>
<label>
<span class="title"><?php esc_html_e( 'Sold individually?', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="sold_individually" name="_sold_individually">
<?php
$options = array(
'' => __( '— No change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
?>
</select>
</span>
</label>
<?php do_action( 'woocommerce_product_bulk_edit_end' ); ?>
<input type="hidden" name="woocommerce_bulk_edit" value="1" />
<input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo wp_create_nonce( 'woocommerce_quick_edit_nonce' ); ?>" />
</div>
</fieldset>

View File

@@ -0,0 +1,20 @@
<?php
/**
* Admin View: Email Template Preview
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquet diam a facilisis eleifend. Cras ac justo felis. Mauris faucibus, orci eu blandit fermentum, lorem nibh sollicitudin mi, sit amet interdum metus urna ut lacus.</p>
<p><a class="link" href="#">Sed sit amet sapien odio</a></p>
<p>Phasellus quis varius augue. Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>
<h2>Lorem ipsum dolor</h2>
<p>Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>

View File

@@ -0,0 +1,14 @@
<?php
/**
* Admin View: Custom Notices
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', $notice ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
<?php echo wp_kses_post( wpautop( $notice_html ) ); ?>
</div>

View File

@@ -0,0 +1,14 @@
<?php
/**
* Admin View: Notice - Install
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p><?php _e( '<strong>Welcome to WooCommerce</strong> &#8211; You&lsquo;re almost ready to start selling :)', 'woocommerce' ); ?></p>
<p class="submit"><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-setup' ) ); ?>" class="button-primary"><?php _e( 'Run the Setup Wizard', 'woocommerce' ); ?></a> <a class="button-secondary skip" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'install' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Skip setup', 'woocommerce' ); ?></a></p>
</div>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Admin View: Notice - Legacy Shipping.
*
* @package WooCommerce\Admin\Notices
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'legacy_shipping' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>">
<?php esc_html_e( 'Dismiss', 'woocommerce' ); ?>
</a>
<p class="main">
<strong><?php esc_html_e( 'New:', 'woocommerce' ); ?> <?php esc_html_e( 'Shipping zones', 'woocommerce' ); ?></strong> &#8211; <?php esc_html_e( 'a group of regions that can be assigned different shipping methods and rates.', 'woocommerce' ); ?>
</p>
<p>
<?php esc_html_e( 'Legacy shipping methods (flat rate, international flat rate, local pickup and delivery, and free shipping) are deprecated but will continue to work as normal for now. <b><em>They will be removed in future versions of WooCommerce</em></b>. We recommend disabling these and setting up new rates within shipping zones as soon as possible.', 'woocommerce' ); ?>
</p>
<p class="submit">
<?php if ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) : ?>
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping' ) ); ?>">
<?php esc_html_e( 'Setup shipping zones', 'woocommerce' ); ?>
</a>
<?php endif; ?>
<a class="button-secondary" href="https://docs.woocommerce.com/document/setting-up-shipping-zones/">
<?php esc_html_e( 'Learn more about shipping zones', 'woocommerce' ); ?>
</a>
</p>
</div>

View File

@@ -0,0 +1,31 @@
<?php
/**
* Admin View: Notice - Missing MaxMind license key
*
* @package WooCommerce\Admin
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'maxmind_license_key' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p>
<strong><?php esc_html_e( 'Geolocation has not been configured.', 'woocommerce' ); ?></strong>
</p>
<p>
<?php
echo wp_kses_post(
sprintf(
/* translators: %1%s: integration page %2$s: general settings page */
__( 'You must enter a valid license key on the <a href="%1$s">MaxMind integration settings page</a> in order to use the geolocation service. If you do not need geolocation for shipping or taxes, you should change the default customer location on the <a href="%2$s">general settings page</a>.', 'woocommerce' ),
admin_url( 'admin.php?page=wc-settings&tab=integration&section=maxmind_geolocation' ),
admin_url( 'admin.php?page=wc-settings&tab=general' )
)
);
?>
</p>
</div>

View File

@@ -0,0 +1,37 @@
<?php
/**
* Admin View: Notice - No Shipping methods.
*
* @package WooCommerce\Admin\Notices
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'no_shipping_methods' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>">
<?php esc_html_e( 'Dismiss', 'woocommerce' ); ?>
</a>
<p class="main">
<strong>
<?php esc_html_e( 'Add shipping methods &amp; zones', 'woocommerce' ); ?>
</strong>
</p>
<p>
<?php esc_html_e( 'Shipping is currently enabled, but you have not added any shipping methods to your shipping zones.', 'woocommerce' ); ?>
</p>
<p>
<?php esc_html_e( 'Customers will not be able to purchase physical goods from your store until a shipping method is available.', 'woocommerce' ); ?>
</p>
<p class="submit">
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping' ) ); ?>">
<?php esc_html_e( 'Setup shipping zones', 'woocommerce' ); ?>
</a>
<a class="button-secondary" href="https://docs.woocommerce.com/document/setting-up-shipping-zones/">
<?php esc_html_e( 'Learn more about shipping zones', 'woocommerce' ); ?>
</a>
</p>
</div>

View File

@@ -0,0 +1,26 @@
<?php
/**
* Admin View: Notice - Regenerating product lookup table.
*
* @package WooCommerce/admin
*/
defined( 'ABSPATH' ) || exit;
$pending_actions_url = admin_url( 'admin.php?page=wc-status&tab=action-scheduler&s=wc_update_product_lookup_tables&status=pending' );
$cron_disabled = defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON;
$cron_cta = $cron_disabled ? __( 'You can manually run queued updates here.', 'woocommerce' ) : __( 'View progress &rarr;', 'woocommerce' );
?>
<div id="message" class="updated woocommerce-message">
<p>
<strong><?php esc_html_e( 'WooCommerce is updating product data in the background', 'woocommerce' ); ?></strong><br>
<?php
esc_html_e( 'Product display, sorting, and reports may not be accurate until this finishes. It will take a few minutes and this notice will disappear when complete.', 'woocommerce' );
if ( $cron_disabled ) {
echo '<br>' . esc_html__( 'Note: WP CRON has been disabled on your install which may prevent this update from completing.', 'woocommerce' );
}
?>
&nbsp;<a href="<?php echo esc_url( $pending_actions_url ); ?>"><?php echo esc_html( $cron_cta ); ?></a>
</p>
</div>

View File

@@ -0,0 +1,13 @@
<?php
/**
* Admin View: Notice - Regenerating thumbnails.
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'regenerating_thumbnails' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Cancel thumbnail regeneration', 'woocommerce' ); ?></a>
<p><?php esc_html_e( 'Thumbnail regeneration is running in the background. Depending on the amount of images in your store this may take a while.', 'woocommerce' ); ?></p>
</div>

View File

@@ -0,0 +1,23 @@
<?php
/**
* Admin View: Notice - Secure connection.
*
* @package WooCommerce\Admin\Notices
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'no_secure_connection' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p>
<?php
echo wp_kses_post( sprintf(
/* translators: %s: documentation URL */
__( 'Your store does not appear to be using a secure connection. We highly recommend serving your entire website over an HTTPS connection to help keep customer data secure. <a href="%s">Learn more here.</a>', 'woocommerce' ),
'https://docs.woocommerce.com/document/ssl-and-https/'
) );
?>
</p>
</div>

View File

@@ -0,0 +1,29 @@
<?php
/**
* Admin View: Notice - Template Check
*
* @package WooCommerce/Views
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$theme = wp_get_theme();
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'template_files' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p>
<?php /* translators: %s: theme name */ ?>
<?php printf( __( '<strong>Your theme (%s) contains outdated copies of some WooCommerce template files.</strong> These files may need updating to ensure they are compatible with the current version of WooCommerce. Suggestions to fix this:', 'woocommerce' ), esc_html( $theme['Name'] ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>
<ol>
<li><?php esc_html_e( 'Update your theme to the latest version. If no update is available contact your theme author asking about compatibility with the current WooCommerce version.', 'woocommerce' ); ?></li>
<li><?php esc_html_e( 'If you copied over a template file to change something, then you will need to copy the new version of the template and apply your changes again.', 'woocommerce' ); ?></li>
</ol>
</p>
<p class="submit">
<a class="button-primary" href="https://docs.woocommerce.com/document/template-structure/" target="_blank"><?php esc_html_e( 'Learn more about templates', 'woocommerce' ); ?></a>
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-status' ) ); ?>" target="_blank"><?php esc_html_e( 'View affected templates', 'woocommerce' ); ?></a>
</p>
</div>

View File

@@ -0,0 +1,39 @@
<?php
/**
* Admin View: Notice - Update
*
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$update_url = wp_nonce_url(
add_query_arg( 'do_update_woocommerce', 'true', admin_url( 'admin.php?page=wc-settings' ) ),
'wc_db_update',
'wc_db_update_nonce'
);
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p>
<strong><?php esc_html_e( 'WooCommerce database update required', 'woocommerce' ); ?></strong>
</p>
<p>
<?php
esc_html_e( 'WooCommerce has been updated! To keep things running smoothly, we have to update your database to the newest version.', 'woocommerce' );
/* translators: 1: Link to docs 2: Close link. */
printf( ' ' . esc_html__( 'The database update process runs in the background and may take a little while, so please be patient. Advanced users can alternatively update via %1$sWP CLI%2$s.', 'woocommerce' ), '<a href="https://github.com/woocommerce/woocommerce/wiki/Upgrading-the-database-using-WP-CLI">', '</a>' );
?>
</p>
<p class="submit">
<a href="<?php echo esc_url( $update_url ); ?>" class="wc-update-now button-primary">
<?php esc_html_e( 'Update WooCommerce Database', 'woocommerce' ); ?>
</a>
<a href="https://docs.woocommerce.com/document/how-to-update-woocommerce/" class="button-secondary">
<?php esc_html_e( 'Learn more about updates', 'woocommerce' ); ?>
</a>
</p>
</div>

View File

@@ -0,0 +1,17 @@
<?php
/**
* Admin View: Notice - Updated.
*
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message wc-connect woocommerce-message--success">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'update', remove_query_arg( 'do_update_woocommerce' ) ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p><?php esc_html_e( 'WooCommerce database update complete. Thank you for updating to the latest version!', 'woocommerce' ); ?></p>
</div>

View File

@@ -0,0 +1,27 @@
<?php
/**
* Admin View: Notice - Updating
*
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$pending_actions_url = admin_url( 'admin.php?page=wc-status&tab=action-scheduler&s=woocommerce_run_update&status=pending' );
$cron_disabled = defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON;
$cron_cta = $cron_disabled ? __( 'You can manually run queued updates here.', 'woocommerce' ) : __( 'View progress &rarr;', 'woocommerce' );
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p>
<strong><?php esc_html_e( 'WooCommerce database update', 'woocommerce' ); ?></strong><br>
<?php esc_html_e( 'WooCommerce is updating the database in the background. The database update process may take a little while, so please be patient.', 'woocommerce' ); ?>
<?php
if ( $cron_disabled ) {
echo '<br>' . esc_html__( 'Note: WP CRON has been disabled on your install which may prevent this update from completing.', 'woocommerce' );
}
?>
&nbsp;<a href="<?php echo esc_url( $pending_actions_url ); ?>"><?php echo esc_html( $cron_cta ); ?></a>
</p>
</div>

View File

@@ -0,0 +1,35 @@
<?php
/**
* Admin View: Notice - WooCommerce Admin Feature Plugin
*
* @package admin.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message woocommerce-admin-promo-messages">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'wc_admin' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p>
<?php echo wp_kses_post( __( 'Test drive the future of WooCommerce. A quicker, javascript powered interface with exciting new features and reports.', 'woocommerce' ) ); ?>
</p>
<?php if ( file_exists( WP_PLUGIN_DIR . '/woocommerce-admin/woocommerce-admin.php' ) && ! is_plugin_active( 'woocommerce-admin/woocommerce-admin.php' ) && current_user_can( 'activate_plugin', 'woocommerce-admin/woocommerce-admin.php' ) ) : ?>
<p>
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=woocommerce-admin/woocommerce-admin.php&plugin_status=active' ), 'activate-plugin_woocommerce-admin/woocommerce-admin.php' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate WooCommerce Admin', 'woocommerce' ); ?></a>
</p>
<?php else : ?>
<?php
if ( current_user_can( 'install_plugins' ) ) {
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce-admin' ), 'install-plugin_woocommerce-admin' );
} else {
$url = 'https://wordpress.org/plugins/woocommerce-admin/';
}
?>
<p>
<a href="<?php echo esc_url( $url ); ?>" class="button button-primary"><?php esc_html_e( 'Install WooCommerce Admin', 'woocommerce' ); ?></a>
</p>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,31 @@
<?php
/**
* Admin View: Notice - PHP & WP minimum requirements.
*
* @package WooCommerce\Admin\Notices
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', WC_PHP_MIN_REQUIREMENTS_NOTICE ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p>
<?php
echo wp_kses_post(
sprintf(
$msg . '<p><a href="%s" class="button button-primary">' . __( 'Learn how to upgrade', 'woocommerce' ) . '</a></p>',
add_query_arg(
array(
'utm_source' => 'wpphpupdatebanner',
'utm_medium' => 'product',
'utm_campaign' => 'woocommerceplugin',
'utm_content' => 'docs',
),
'https://docs.woocommerce.com/document/update-php-wordpress/'
)
)
);
?>
</p>
</div>

View File

@@ -0,0 +1,214 @@
<?php
/**
* Admin View: Quick Edit Product
*
* @package admin.
*/
defined( 'ABSPATH' ) || exit;
?>
<fieldset class="inline-edit-col-left">
<div id="woocommerce-fields" class="inline-edit-col">
<h4><?php esc_html_e( 'Product data', 'woocommerce' ); ?></h4>
<?php do_action( 'woocommerce_product_quick_edit_start' ); ?>
<?php if ( wc_product_sku_enabled() ) : ?>
<label>
<span class="title"><?php esc_html_e( 'SKU', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<input type="text" name="_sku" class="text sku" value="">
</span>
</label>
<br class="clear" />
<?php endif; ?>
<div class="price_fields">
<label>
<span class="title"><?php esc_html_e( 'Price', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<input type="text" name="_regular_price" class="text wc_input_price regular_price" placeholder="<?php esc_attr_e( 'Regular price', 'woocommerce' ); ?>" value="">
</span>
</label>
<br class="clear" />
<label>
<span class="title"><?php esc_html_e( 'Sale', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<input type="text" name="_sale_price" class="text wc_input_price sale_price" placeholder="<?php esc_attr_e( 'Sale price', 'woocommerce' ); ?>" value="">
</span>
</label>
<br class="clear" />
</div>
<?php if ( wc_tax_enabled() ) : ?>
<label class="alignleft">
<span class="title"><?php esc_html_e( 'Tax status', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="tax_status" name="_tax_status">
<?php
$options = array(
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
?>
</select>
</span>
</label>
<br class="clear" />
<label class="alignleft">
<span class="title"><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="tax_class" name="_tax_class">
<?php
$options = array(
'' => __( 'Standard', 'woocommerce' ),
);
$tax_classes = WC_Tax::get_tax_classes();
if ( ! empty( $tax_classes ) ) {
foreach ( $tax_classes as $class ) {
$options[ sanitize_title( $class ) ] = esc_html( $class );
}
}
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
?>
</select>
</span>
</label>
<br class="clear" />
<?php endif; ?>
<?php if ( wc_product_weight_enabled() || wc_product_dimensions_enabled() ) : ?>
<div class="dimension_fields">
<?php if ( wc_product_weight_enabled() ) : ?>
<label>
<span class="title"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<input type="text" name="_weight" class="text weight" placeholder="<?php echo esc_attr( wc_format_localized_decimal( 0 ) ); ?>" value="">
</span>
</label>
<br class="clear" />
<?php endif; ?>
<?php if ( wc_product_dimensions_enabled() ) : ?>
<div class="inline-edit-group dimensions">
<div>
<span class="title"><?php esc_html_e( 'L/W/H', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<input type="text" name="_length" class="text wc_input_decimal length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" value="">
<input type="text" name="_width" class="text wc_input_decimal width" placeholder="<?php esc_attr_e( 'Width', 'woocommerce' ); ?>" value="">
<input type="text" name="_height" class="text wc_input_decimal height" placeholder="<?php esc_attr_e( 'Height', 'woocommerce' ); ?>" value="">
</span>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="inline-edit-group">
<span class="title"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="shipping_class" name="_shipping_class">
<option value="_no_shipping_class"><?php esc_html_e( 'No shipping class', 'woocommerce' ); ?></option>
<?php
foreach ( $shipping_class as $key => $value ) {
echo '<option value="' . esc_attr( $value->slug ) . '">' . esc_html( $value->name ) . '</option>';
}
?>
</select>
</span>
</div>
<div class="inline-edit-group">
<label class="alignleft">
<span class="title"><?php esc_html_e( 'Visibility', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="visibility" name="_visibility">
<?php
$options = apply_filters(
'woocommerce_product_visibility_options', array(
'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' ),
)
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
?>
</select>
</span>
</label>
<label class="alignleft featured">
<input type="checkbox" name="_featured" value="1">
<span class="checkbox-title"><?php esc_html_e( 'Featured', 'woocommerce' ); ?></span>
</label>
</div>
<?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?>
<div class="inline-edit-group manage_stock_field">
<label class="manage_stock">
<input type="checkbox" name="_manage_stock" value="1">
<span class="checkbox-title"><?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?></span>
</label>
</div>
<?php endif; ?>
<label class="stock_status_field">
<span class="title"><?php esc_html_e( 'In stock?', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="stock_status" name="_stock_status">
<?php
foreach ( wc_get_product_stock_status_options() as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
?>
</select>
</span>
</label>
<div class="stock_fields">
<?php if ( get_option( 'woocommerce_manage_stock' ) === 'yes' ) : ?>
<label class="stock_qty_field">
<span class="title"><?php esc_html_e( 'Stock qty', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<input type="number" name="_stock" class="text stock" step="any" value="">
</span>
</label>
<?php endif; ?>
</div>
<label class="alignleft backorder_field">
<span class="title"><?php esc_html_e( 'Backorders?', 'woocommerce' ); ?></span>
<span class="input-text-wrap">
<select class="backorders" name="_backorders">
<?php
foreach ( wc_get_product_backorder_options() as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
?>
</select>
</span>
</label>
<?php do_action( 'woocommerce_product_quick_edit_end' ); ?>
<input type="hidden" name="woocommerce_quick_edit" value="1" />
<input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo esc_attr( wp_create_nonce( 'woocommerce_quick_edit_nonce' ) ); ?>" />
</div>
</fieldset>

View File

@@ -0,0 +1,102 @@
<?php
/**
* Admin View: Report by Date (with date filters)
*
* @package WooCommerce/Admin/Reporting
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div id="poststuff" class="woocommerce-reports-wide">
<div class="postbox">
<?php if ( 'custom' === $current_range && isset( $_GET['start_date'], $_GET['end_date'] ) ) : ?>
<h3 class="screen-reader-text">
<?php
/* translators: 1: start date 2: end date */
printf(
esc_html__( 'From %1$s to %2$s', 'woocommerce' ),
esc_html( wc_clean( wp_unslash( $_GET['start_date'] ) ) ),
esc_html( wc_clean( wp_unslash( $_GET['end_date'] ) ) )
);
?>
</h3>
<?php else : ?>
<h3 class="screen-reader-text"><?php echo esc_html( $ranges[ $current_range ] ); ?></h3>
<?php endif; ?>
<div class="stats_range">
<?php $this->get_export_button(); ?>
<ul>
<?php
foreach ( $ranges as $range => $name ) {
echo '<li class="' . ( $current_range == $range ? 'active' : '' ) . '"><a href="' . esc_url( remove_query_arg( array( 'start_date', 'end_date' ), add_query_arg( 'range', $range ) ) ) . '">' . esc_html( $name ) . '</a></li>';
}
?>
<li class="custom <?php echo ( 'custom' === $current_range ) ? 'active' : ''; ?>">
<?php esc_html_e( 'Custom:', 'woocommerce' ); ?>
<form method="GET">
<div>
<?php
// Maintain query string.
foreach ( $_GET as $key => $value ) {
if ( is_array( $value ) ) {
foreach ( $value as $v ) {
echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '[]" value="' . esc_attr( sanitize_text_field( $v ) ) . '" />';
}
} else {
echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '" value="' . esc_attr( sanitize_text_field( $value ) ) . '" />';
}
}
?>
<input type="hidden" name="range" value="custom" />
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( wp_unslash( $_GET['start_date'] ) ) : ''; ?>" name="start_date" class="range_datepicker from" autocomplete="off" /><?php //@codingStandardsIgnoreLine ?>
<span>&ndash;</span>
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( wp_unslash( $_GET['end_date'] ) ) : ''; ?>" name="end_date" class="range_datepicker to" autocomplete="off" /><?php //@codingStandardsIgnoreLine ?>
<button type="submit" class="button" value="<?php esc_attr_e( 'Go', 'woocommerce' ); ?>"><?php esc_html_e( 'Go', 'woocommerce' ); ?></button>
<?php wp_nonce_field( 'custom_range', 'wc_reports_nonce', false ); ?>
</div>
</form>
</li>
</ul>
</div>
<?php if ( empty( $hide_sidebar ) ) : ?>
<div class="inside chart-with-sidebar">
<div class="chart-sidebar">
<?php if ( $legends = $this->get_chart_legend() ) : ?>
<ul class="chart-legend">
<?php foreach ( $legends as $legend ) : ?>
<?php // @codingStandardsIgnoreStart ?>
<li style="border-color: <?php echo $legend['color']; ?>" <?php if ( isset( $legend['highlight_series'] ) ) echo 'class="highlight_series ' . ( isset( $legend['placeholder'] ) ? 'tips' : '' ) . '" data-series="' . esc_attr( $legend['highlight_series'] ) . '"'; ?> data-tip="<?php echo isset( $legend['placeholder'] ) ? $legend['placeholder'] : ''; ?>">
<?php echo $legend['title']; ?>
</li>
<?php // @codingStandardsIgnoreEnd ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<ul class="chart-widgets">
<?php foreach ( $this->get_chart_widgets() as $widget ) : ?>
<li class="chart-widget">
<?php if ( $widget['title'] ) : ?>
<h4><?php echo esc_html( $widget['title'] ); ?></h4>
<?php endif; ?>
<?php call_user_func( $widget['callback'] ); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="main">
<?php $this->get_main_chart(); ?>
</div>
</div>
<?php else : ?>
<div class="inside">
<?php $this->get_main_chart(); ?>
</div>
<?php endif; ?>
</div>
</div>