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

$iwbvel_woo_multi_currency_params = get_option('woo_multi_currency_params', []);
if (!empty($iwbvel_woo_multi_currency_params) && isset($iwbvel_woo_multi_currency_params['enable_fixed_price']) && intval($iwbvel_woo_multi_currency_params['enable_fixed_price']) === 1) :
    // delete default currency
    if (!empty($iwbvel_woo_multi_currency_params['currency'][0])) {
        unset($iwbvel_woo_multi_currency_params['currency'][0]);
    }

    // get active currencies
    if (!empty($iwbvel_woo_multi_currency_params['currency'])) :
        if (!empty($iwbvel_woo_multi_currency_params['currency']) && is_array($iwbvel_woo_multi_currency_params['currency'])) :
?>
            <strong>By Villa Theme</strong>
            <hr>

            <?php foreach ($iwbvel_woo_multi_currency_params['currency'] as $iwbvel_currency) : ?>
                <div class="iwbvel-form-group" data-name="_regular_price_wmcp_-_<?php echo esc_attr($iwbvel_currency); ?>">
                    <label for="iwbvel-filter-form-woo-multi-currency-regular-price-<?php echo esc_attr($iwbvel_currency); ?>-from"><?php echo esc_html('Regular price (' . $iwbvel_currency . ')'); ?></label>
                    <input type="number" data-field="from" data-field-type="regular" data-field-name="_regular_price_wmcp_-_<?php echo esc_attr($iwbvel_currency); ?>" class="iwbvel-input-ft" id="iwbvel-filter-form-woo-multi-currency-regular-price-<?php echo esc_attr($iwbvel_currency); ?>-from" placeholder="<?php esc_attr_e('From', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
                    <input type="number" data-field="to" class="iwbvel-input-ft" id="iwbvel-filter-form-woo-multi-currency-regular-price-<?php echo esc_attr($iwbvel_currency); ?>-to" placeholder="<?php esc_attr_e('To', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
                </div>
                <div class="iwbvel-form-group" data-name="_sale_price_wmcp_-_<?php echo esc_attr($iwbvel_currency); ?>">
                    <label for="iwbvel-filter-form-woo-multi-currency-sale-price-<?php echo esc_attr($iwbvel_currency); ?>-from"><?php echo esc_html('Sale price (' . $iwbvel_currency . ')'); ?></label>
                    <input type="number" data-field="from" data-field-type="sale" data-field-name="_regular_price_wmcp_-_<?php echo esc_attr($iwbvel_currency); ?>" class="iwbvel-input-ft" id="iwbvel-filter-form-woo-multi-currency-sale-price-<?php echo esc_attr($iwbvel_currency); ?>-from" placeholder="<?php esc_attr_e('From', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
                    <input type="number" data-field="to" class="iwbvel-input-ft" id="iwbvel-filter-form-woo-multi-currency-sale-price-<?php echo esc_attr($iwbvel_currency); ?>-to" placeholder="<?php esc_attr_e('To', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
                </div>
<?php
            endforeach;
        endif;
    endif;
endif;
