Completed
Push — master ( 07eadf...5397e4 )
by Mike
20:38 queued 11s
created

WC_Meta_Box_Order_Notes::output()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 27
ccs 0
cts 15
cp 0
crap 2
rs 9.488
c 0
b 0
f 0
1
<?php
2
/**
3
 * Order Notes
4
 *
5
 * @package WooCommerce/Admin/Meta Boxes
6
 */
7
8
if ( ! defined( 'ABSPATH' ) ) {
9
	exit;
10
}
11
12
/**
13
 * WC_Meta_Box_Order_Notes Class.
14
 */
15
class WC_Meta_Box_Order_Notes {
16
17
	/**
18
	 * Output the metabox.
19
	 *
20
	 * @param WP_Post $post Post object.
21
	 */
22
	public static function output( $post ) {
23
		global $post;
24
25
		$args = array(
26
			'order_id' => $post->ID,
27
		);
28
29
		$notes = wc_get_order_notes( $args );
30
31
		include 'views/html-order-notes.php';
32
		?>
33
		<div class="add_note">
34
			<p>
35
				<label for="add_order_note"><?php esc_html_e( 'Add note', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Add a note for your reference, or add a customer note (the user will be notified).', 'woocommerce' ) ); ?></label>
36
				<textarea type="text" name="order_note" id="add_order_note" class="input-text" cols="20" rows="5"></textarea>
37
			</p>
38
			<p>
39
				<label for="order_note_type" class="screen-reader-text"><?php esc_html_e( 'Note type', 'woocommerce' ); ?></label>
40
				<select name="order_note_type" id="order_note_type">
41
					<option value=""><?php esc_html_e( 'Private note', 'woocommerce' ); ?></option>
42
					<option value="customer"><?php esc_html_e( 'Note to customer', 'woocommerce' ); ?></option>
43
				</select>
44
				<button type="button" class="add_note button"><?php esc_html_e( 'Add', 'woocommerce' ); ?></button>
45
			</p>
46
		</div>
47
		<?php
48
	}
49
}
50