Skip to content

Commit

Permalink
search filter of type taxonomy
Browse files Browse the repository at this point in the history
  • Loading branch information
shraddha404 committed Jul 5, 2024
1 parent a8d0141 commit e5eeec3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions resources/views/collection.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,23 @@ function randomString(length) {
<input type="hidden" name="operator[]" value="contains" />
<input type="hidden" name="meta_type[]" value="{{ $m->type }}" />
</div>
@elseif($m->type == 'TaxonomyTree')
<div class="float-container">
<label for="meta_{{ $m->id }}_search" class="search-label">{{ $m->label }}</label>
<select class="selectpicker" id="meta_{{ $m->id }}_search" title="{{ $m->label }}" name="meta_value[{{ $m->id }}][]" onchange="this.form.submit();">
@php
//$options = explode(",", $m->options);
$taxonomy_m = App\Taxonomy::find($m->options);
$children = $taxonomy_m->childs;
@endphp
@foreach($children as $c)
<option value="{{ $c->id }}">{{ $c->label }}</option>
@endforeach
</select>
<input type="hidden" name="meta_field[]" value="{{ $m->id }}" />
<input type="hidden" name="operator[]" value="contains" />
<input type="hidden" name="meta_type[]" value="{{ $m->type }}" />
</div>
@endif
</form>
@endif
Expand Down

0 comments on commit e5eeec3

Please sign in to comment.