<ul class="isl-nodetree">
  <li>
    <div>

      <div class="isl-margin">
        If the customer buys
        <input type="number" name="<?php echo $module_setting; ?>[condition_min_quantity]" value="<?php echo $setting['item']['condition_min_quantity']; ?>" min="1" class="form-control input-sm isl-inline-block isl-w-xs isl-mh-5" required>
        <label class="isl-p0 isl-mr-5" data-toggle="tooltip" title="Select this option to apply only once regardless of how many products are purchased."><input type="checkbox" name="<?php echo $module_setting; ?>[apply_once]" value="1" <?php echo $setting['item']['apply_once'] ? 'checked' : ''; ?>> (or more)</label>
        of the following products
      </div>
      <div class="isl-margin isl-w-l">
        <input type="text" placeholder="Type product name" data-isl-autocomplete='{"type":"product", "target":"isl-autocomplete-a", "name":"<?php echo $module_setting; ?>[condition_product_ids][]"}' class="form-control input-sm">
        <div class="well well-sm isl-well isl-autocomplete-a">
          <?php foreach ($condition_product_ids_data as $product) { ?>
            <div class="isl-autocomplete-a<?php echo $product['product_id']; ?>"><i class="fa fa-minus-circle pointer"></i> <?php echo $product['name']; ?><input type="hidden" name="<?php echo $module_setting; ?>[condition_product_ids][]" value="<?php echo $product['product_id']; ?>"></div>
          <?php } ?>
        </div>
      </div>

    </div>
  </li>
  <li>
    <div>

      <div class="isl-margin">
        then they will get
        <input type="number" name="<?php echo $module_setting; ?>[discount_quantity]" value="<?php echo $setting['item']['discount_quantity']; ?>" min="1" class="form-control input-sm isl-inline-block isl-w-xs isl-mh-5" required>
        of the following products for free
      </div>
      <div class="isl-margin isl-w-l">
        <input type="text" placeholder="Type product name" data-isl-autocomplete='{"type":"product", "target":"isl-autocomplete-b", "name":"<?php echo $module_setting; ?>[discount_product_ids][]"}' class="form-control input-sm">
        <div class="well well-sm isl-well isl-autocomplete-b">
          <?php foreach ($discount_product_ids_data as $product) { ?>
            <div class="isl-autocomplete-b<?php echo $product['product_id']; ?>"><i class="fa fa-minus-circle pointer"></i> <?php echo $product['name']; ?><input type="hidden" name="<?php echo $module_setting; ?>[discount_product_ids][]" value="<?php echo $product['product_id']; ?>"></div>
          <?php } ?>
        </div>
      </div>

    </div>
  </li>
</ul>

<script>
$(document).trigger('isl.autocomplete');
</script>
