<?php

/**
 * WooCommerce Settings Wrapper.
 *
 * Shows disabled fields with PRO badge for free users, actual settings for premium users.
 *
 * @since   4.4.0
 * @package Extra Product Options for WooCommerce
 *
 * Available Variables (from element-form.php):
 * @var array  $epofw_field_data        The field/element data array.
 * @var string $epofw_field_type        The field type (text, select, etc.).
 * @var string $epofw_field_name_prefix The form field name prefix.
 * @var string $epofw_field_id          The field ID/key.
 */
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
// Get premium field data for disabled state.
$epofw_prem_data = epofw_get_premium_field_data();
?>

<div class="epofw-tab-content" data-tab="woocommerce-settings">
	<div class="epofw-onboarding-hint">
		<div class="epofw-onboarding-hint-content">
			<span class="epofw-onboarding-icon"><i class="dashicons dashicons-info-outline"></i></span>
			<span class="epofw-onboarding-text"><?php 
esc_html_e( 'Control how addon fields appear across your store - hide prices, customize cart/checkout display, and configure tax settings for each field.', 'extra-product-options-for-woocommerce' );
?></span>
		</div>
		<?php 
epofw_render_tutorial_buttons( 'woocommerce_settings', 'small', true );
?>
	</div>
	<?php 
// Free users: Show disabled fields with PRO badge.
?>
		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_hide_price_on_product_page"><?php 
esc_html_e( 'Hide Price on Product Page', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'When enabled, the addon field price will be hidden from customers on the product page. This is useful for fields where you want to show the option but not reveal the cost until checkout.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" id="hop" value="on"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
				<label for="hop" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_haoic"><?php 
esc_html_e( 'Hide Addon Options in Cart', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'When enabled, the addon field options will be hidden from customers on the cart page.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" id="epofw_haoic" value="on"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
				<label for="epofw_haoic" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_haopic"><?php 
esc_html_e( 'Hide Addon Options Price in Cart', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'When enabled, the addon field price will be hidden from customers on the cart page.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" id="epofw_haopic" value="on"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
				<label for="epofw_haopic" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_haoiod"><?php 
esc_html_e( 'Hide Addon Options in Order Details', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'When enabled, the addon field options will be hidden from customers on the order details, order confirmation emails, and admin order pages.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" id="epofw_haoiod" value="on"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
				<label for="epofw_haoiod" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_haopiod"><?php 
esc_html_e( 'Hide Addon Price in Order Details', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'When enabled, the addon field price will be hidden from customers on the order details, order confirmation emails, and admin order pages.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" id="epofw_haopiod" value="on"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
				<label for="epofw_haopiod" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_addon_vat"><?php 
esc_html_e( 'Addon Tax Settings', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'Select the specific tax to apply to this addon field.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select id="epofw_addon_vat" class="epofw-form-control"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
					<option value="bops"><?php 
esc_html_e( 'Based on product setting', 'extra-product-options-for-woocommerce' );
?></option>
					<option value="yes"><?php 
esc_html_e( 'Yes', 'extra-product-options-for-woocommerce' );
?></option>
					<option value="no"><?php 
esc_html_e( 'No', 'extra-product-options-for-woocommerce' );
?></option>
				</select>
			</div>
		</div>

		<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data['class'] );
?>">
			<div class="epofw-field-label">
				<label for="epofw_addon_vat_rates"><?php 
esc_html_e( 'Addon Tax Rate', 'extra-product-options-for-woocommerce' );
echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
?></label>
				<div class="epofw-field-description">
					<?php 
esc_html_e( 'Select the specific tax rate to apply to this addon field.', 'extra-product-options-for-woocommerce' );
?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select id="epofw_addon_vat_rates" class="epofw-form-control"<?php 
echo esc_attr( $epofw_prem_data['disabled'] );
?>>
					<option value="bops"><?php 
esc_html_e( 'Based on product setting', 'extra-product-options-for-woocommerce' );
?></option>
					<option value="standard"><?php 
esc_html_e( 'Standard', 'extra-product-options-for-woocommerce' );
?></option>
					<option value="reduced-rate"><?php 
esc_html_e( 'Reduced rate', 'extra-product-options-for-woocommerce' );
?></option>
					<option value="zero-rate"><?php 
esc_html_e( 'Zero rate', 'extra-product-options-for-woocommerce' );
?></option>
				</select>
			</div>
		</div>
		<?php 
?>
</div>
