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

use iwbvel\classes\helpers\Sanitizer;
use iwbvel\classes\repositories\Product;

$iwbvel_product_repository = Product::get_instance();
$iwbvel_wc_vendors = $iwbvel_product_repository->get_wc_product_vendors();
$iwbvel_wc_vendors_options = '';
if (!empty($iwbvel_wc_vendors)) {
    foreach ($iwbvel_wc_vendors as $iwbvel_wc_vendor) {
        if ($iwbvel_wc_vendor instanceof \WP_Term) {
            $iwbvel_wc_vendors_options .= '<option value="' . esc_attr($iwbvel_wc_vendor->slug) . '">' . esc_html($iwbvel_wc_vendor->name) . '</option>';
        }
    }
}
?>

<strong>By WooCommerce</strong>
<hr>
<div class="iwbvel-form-group" data-name="_wcpv_product_commission" data-type="meta_field">
    <label for="iwbvel-bulk-edit-form-wc-product-commission"><?php esc_html_e('Product commission', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
    <select id="iwbvel-bulk-edit-form-wc-product-commission-operator" data-field="operator">
        <?php include IWBVEL_VIEWS_DIR . "bulk_edit/bulk_edit_form/operators/number.php"; ?>
    </select>
    <input type="number" data-field="value" id="iwbvel-bulk-edit-form-wc-product-commission" placeholder="<?php esc_attr_e('Product commission', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
    <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>
</div>
<div class="iwbvel-form-group" data-name="_wcpv_product_taxes" data-type="meta_field">
    <label for="iwbvel-bulk-edit-form-wc-tax-handling"><?php esc_html_e('Tax handling', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
    <select id="iwbvel-bulk-edit-form-wc-tax-handling" data-field="value" class="iwbvel-input-ft">
        <option value=""><?php esc_html_e('Select', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
        <option value="keep-tax"><?php esc_html_e('Keep taxes', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
        <option value="pass-tax"><?php esc_html_e('Pass taxes', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
        <option value="split-tax"><?php esc_html_e('Split taxes', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
    </select>
</div>
<div class="iwbvel-form-group" data-name="_wcpv_product_pass_shipping" data-type="meta_field">
    <label for="iwbvel-bulk-edit-form-wc-pass-shipping"><?php esc_html_e('Pass shipping', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
    <select id="iwbvel-bulk-edit-form-wc-pass-shipping" data-field="value" class="iwbvel-input-ft">
        <option value=""><?php esc_html_e('Select', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
        <option value="yes"><?php esc_html_e('Yes', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
        <option value="no"><?php esc_html_e('No', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
    </select>
</div>
<div class="iwbvel-form-group" data-name="wcpv_product_vendors" data-type="taxonomy">
    <label for="iwbvel-bulk-edit-form-wc-vendor"><?php esc_html_e('Vendor', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
    <select class="iwbvel-select2" id="iwbvel-bulk-edit-form-wc-vendor" multiple data-field="value">
        <?php echo wp_kses($iwbvel_wc_vendors_options, Sanitizer::allowed_html()); ?>
    </select>
</div>