<?php
if (!defined('ABSPATH')) exit; // Exit if accessed directly 

$iwbvel_items = $edit_form_items['pricing'];

foreach ($iwbvel_items as $iwbvel_name => $iwbvel_item):
    $iwbvel_field_id = 'iwbvel-bulk-edit-form-' . $iwbvel_item['id'];
    $iwbvel_field_type = isset($iwbvel_item['field_type']) ? $iwbvel_item['field_type'] : 'text';
?>
    <div class="iwbvel-form-group" data-name="<?php echo esc_attr($iwbvel_name); ?>" data-type="<?php echo esc_attr($iwbvel_item['update_type']); ?>">
        <div>
            <label for="<?php echo esc_attr($iwbvel_field_id); ?>"><?php echo esc_html($iwbvel_item['label']); ?></label>

            <?php if (!empty($iwbvel_item['operators'])): ?>
                <select <?php echo (isset($iwbvel_item['disabled']) && $iwbvel_item['disabled']) ? 'disabled="disabled"' : ''; ?> id="<?php echo esc_attr($iwbvel_field_id); ?>-operator" data-field="operator">
                    <?php foreach ($iwbvel_item['operators'] as $iwbvel_operator_name => $iwbvel_operator_label): ?>
                        <option value="<?php echo esc_attr($iwbvel_operator_name); ?>"><?php echo esc_html($iwbvel_operator_label); ?></option>
                    <?php endforeach; ?>
                </select>
            <?php endif; ?>

            <?php
            $iwbvel_field_type_path = IWBVEL_VIEWS_DIR . 'bulk_edit/bulk_edit_form/fields_type/' . $iwbvel_field_type . '.php';
            if (file_exists($iwbvel_field_type_path)) {
                include $iwbvel_field_type_path;
            } else {
                include IWBVEL_VIEWS_DIR . 'bulk_edit/bulk_edit_form/fields_type/text.php';
            }
            ?>

            <?php if (isset($iwbvel_item['has_rounding']) && $iwbvel_item['has_rounding']): ?>
                <select <?php echo (isset($iwbvel_item['disabled']) && $iwbvel_item['disabled']) ? 'disabled="disabled"' : ''; ?> data-field="round" id="<?php echo esc_attr($iwbvel_field_id); ?>-round-item" title="<?php esc_attr_e('Select round item', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
                    <?php include IWBVEL_VIEWS_DIR . "bulk_edit/bulk_edit_form/operators/round_items.php"; ?>
                </select>
            <?php endif; ?>

            <?php if (isset($iwbvel_item['formula_note']) && $iwbvel_item['formula_note']): ?>
                <span class="iwbvel-description-full-width"><?php esc_html_e('Note: In formula, the current value known as X. Ex: (X+10)*10% :: (The current value+10) * 10%', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></span>
            <?php endif; ?>
        </div>

        <?php if (isset($iwbvel_item['disabled']) && $iwbvel_item['disabled']): ?>
            <span class="iwbvel-alert-pro-description"><?php esc_html_e('Upgrade to pro version!', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></span>
        <?php endif; ?>
    </div>
<?php endforeach; ?>