I have a low search filter set up which works great however the client now wants to separate the results by country of origin. This should be possible as the country is set by another custom field.
I see this working with Stash, but cannot seem to wrap my head around how to do it.
Working code with all results sorted by title:
{exp:low_search:form query="{segment_3}" result_page="{transcribe:language_abbreviation}/branch-locator/filter" form_id="region-filter" form_onchange='submit()'}
<div class="form-group">
<select class="form-control" name="child:pl_branch_region">
{exp:channel:entries
channel="regions"
dynamic="no"
orderby="title"
sort="asc"
disable="categories|member_data|pagination|custom_fields"
}
{if count=="1"}<option value="">All ({total_results})</option>{/if}
<option value="{entry_id}"{if low_search_child:pl_branch_region == entry_id} selected{/if}>
{title}
</option>
{/exp:channel:entries}
</select>
</div>
{/exp:low_search:form}
What I need to do is separate the results into country which is another field {reg_country} with value of either "can" or "usa"
Ideally the option list would be output like this:
Canada Alberta British Columbia Manitoba etc.... USA Conneticut Maine et..
currently all results are listed alphabetically but not sorted by country.