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

<div class="iwbvel-variations-possible-combinations-rows">
    <?php
    if (!empty($combinations)) :
        foreach ($combinations as $iwbvel_combination) :
            if (!empty($iwbvel_combination)) :
    ?>
                <div class="iwbvel-variations-possible-combinations-row">
                    <input type="checkbox" data-name="enable" value="yes" checked="checked">
                    <?php
                    $iwbvel_j = 0;
                    foreach ($iwbvel_combination as $iwbvel_attribute_name => $iwbvel_term_slug) :
                        $iwbvel_term = get_term_by('slug', $iwbvel_term_slug, $iwbvel_attribute_name);
                        if (!($iwbvel_term instanceof \WP_Term)) {
                            continue;
                        }
                    ?>
                        <input type="hidden" class="iwbvel-variations-possible-combination-item" data-attribute="<?php echo esc_attr($iwbvel_attribute_name); ?>" data-term-slug="<?php echo esc_attr($iwbvel_term_slug); ?>" data-term-id="<?php echo intval($iwbvel_term->term_id); ?>">
                        <span>
                            <?php
                            echo esc_html($iwbvel_term->name);
                            if (($iwbvel_j + 1) < count($iwbvel_combination)) {
                                echo " | ";
                            }
                            $iwbvel_j++
                            ?>
                        </span>
                    <?php endforeach; ?>
                </div>
    <?php
            endif;
        endforeach;
    endif;
    ?>
</div>

<div class="iwbvel-variations-attach-container">
    <button type="button" class="iwbvel-button iwbvel-button-blue iwbvel-variations-attach-for-new-attribute"><i class="iwbvel-icon-check"></i> <?php esc_html_e('Attach', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></button>
</div>