<?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_yith_vendors = $iwbvel_product_repository->get_yith_vendors();
$iwbvel_yith_vendors_options = '';
if (!empty($iwbvel_yith_vendors)) {
    foreach ($iwbvel_yith_vendors as $iwbvel_yith_vendor) {
        if ($iwbvel_yith_vendor instanceof \WP_Term) {
            $iwbvel_yith_vendors_options .= '<option value="' . esc_attr($iwbvel_yith_vendor->slug) . '">' . esc_html($iwbvel_yith_vendor->name) . '</option>';
        }
    }
}
?>

<strong>By Yith</strong>
<hr>
<div class="iwbvel-form-group" data-name="_product_commission" data-type="meta_field">
    <label for="iwbvel-bulk-edit-form-yith-product-commission"><?php esc_html_e('Product commission', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
    <select id="iwbvel-bulk-edit-form-yith-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-yith-product-commission" placeholder="Product commission ...">
    <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="yith_shop_vendor" data-type="taxonomy">
    <label for="iwbvel-bulk-edit-form-yith-vendor"><?php esc_html_e('Vendor', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
    <select id="iwbvel-bulk-edit-form-yith-vendor" class="iwbvel-select2" data-field="value" class="iwbvel-select2" multiple="">
        <?php echo wp_kses($iwbvel_yith_vendors_options, Sanitizer::allowed_html()); ?>
    </select>
</div>