<?php
/**
 * General product tab
 *
 * @package HBFWC
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$product_price = $product->get_price();
?>

<div id="hbfwc_general_product_data" class="panel woocommerce_options_panel">
<?php
	print '<div class="options_group">';

		woocommerce_wp_text_input(
			array(
				'label'       => '<abbr title="Stock Keeping Unit">SKU</abbr>',
				'id'          => 'hbfwc_sku',
				'name'        => '_sku',
				'type'        => 'text',
				'class'       => 'short',
				'value'       => $product->get_sku(),
				'description' => __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'hotel-booking-for-woocommerce' ),
				'desc_tip'    => true,
			)
		);

		woocommerce_wp_text_input(
			array(
				'label'             => __( 'Allotment', 'hotel-booking-for-woocommerce' ),
				'id'                => 'hbfwc_allotment',
				'name'              => '_allotment',
				'type'              => 'number',
				'style'             => 'width: 80px',
				'value'             => ( '' !== $product->get_meta( '_allotment' ) ? $product->get_meta( '_allotment' ) : '1' ),
				'custom_attributes' => array(
					'min'  => '1',
					'step' => '1',
				),
				'description'       => __( 'The total count of this type of room/accommodation listed on this website.', 'hotel-booking-for-woocommerce' ),
				'desc_tip'          => true,
			)
		);

		print '</div>';

		do_action( 'hbfwc_general_product_tab_after_allotment' );

		print '<div class="options_group">';

		woocommerce_wp_text_input(
			array(
				'label'             => __( 'Max Adults', 'hotel-booking-for-woocommerce' ),
				'id'                => 'hbfwc_max_adults',
				'name'              => '_max_adults',
				'type'              => 'number',
				'style'             => 'width: 80px',
				'value'             => ( '' !== $product->get_meta( '_max_adults' ) ? $product->get_meta( '_max_adults' ) : '2' ),
				'custom_attributes' => array(
					'min'  => '1',
					'step' => '1',
				),
				'description'       => __( 'The maximum number of adults that can stay in this unit/room.', 'hotel-booking-for-woocommerce' ),
				'desc_tip'          => true,
			)
		);

		woocommerce_wp_text_input(
			array(
				'label'             => __( 'Max Children', 'hotel-booking-for-woocommerce' ),
				'id'                => 'hbfwc_max_children',
				'name'              => '_max_children',
				'type'              => 'number',
				'style'             => 'width: 80px',
				'value'             => ( '' !== $product->get_meta( '_max_children' ) ? $product->get_meta( '_max_children' ) : '0' ),
				'custom_attributes' => array(
					'min'  => '0',
					'step' => '1',
				),
				'description'       => __( 'The maximum number of children that can stay in this unit/room.', 'hotel-booking-for-woocommerce' ),
				'desc_tip'          => true,
			)
		);

		print '</div>';

		do_action( 'hbfwc_general_product_tab_after_occupancy' );

		print '<div class="options_group">';

		woocommerce_wp_text_input(
			array(
				'label'       => __( 'Bed information', 'hotel-booking-for-woocommerce' ),
				'id'          => 'hbfwc_no_of_beds',
				'name'        => '_no_of_beds',
				'type'        => 'text',
				'style'       => 'width: 50%; max-width: 150px;',
				'value'       => ( '' !== $product->get_meta( '_no_of_beds' ) ? $product->get_meta( '_no_of_beds' ) : '' ),
				'description' => __( 'The number of beds available in this unit/room. E.g. "1 king bed.", "2 single bed."', 'hotel-booking-for-woocommerce' ),
				'desc_tip'    => true,
			)
		);

		woocommerce_wp_text_input(
			array(
				'label'       => __( 'Room size', 'hotel-booking-for-woocommerce' ),
				'id'          => 'hbfwc_room_size',
				'name'        => '_room_size',
				'type'        => 'text',
				'style'       => 'width: 50%; max-width: 150px;',
				'value'       => ( '' !== $product->get_meta( '_room_size' ) ? $product->get_meta( '_room_size' ) : '' ),
				'description' => __( 'The dimensions of the room. Be sure to specify the unit, such as "32 sqm."', 'hotel-booking-for-woocommerce' ),
				'desc_tip'    => true,
			)
		);

		print '</div>';

		do_action( 'hbfwc_general_product_tab_after_information' );
		?>

</div>
