I'm trying to group the results returned from Low Search using Stash. I started by creating a stash list of all the groups, I then tried to create a nested list containing the products for that group.
When I call the get_list, I can return the groups just fine, but trying to fetch the products returns nothing.
Here is my code so far (Bear in mind I know that this will add ALL products into each group, but I'm taking this one step at a time)
{layout="includes/_layout"}
{exp:stash:set parse_conditionals="yes" parse_tags="yes" trim="yes"}
{!-- Set Other Page Data --}
{!-- Results --}
{exp:stash:set_list:searchRanges name="searchRanges" parse_tags="yes" trim="yes"}
{exp:low_search:results query="{segment_3}" collection="products" keywords:lang="en" keywords:inflect="yes" keywords:loose="right" keywords:mode="all" limit="999"}
{stash:itemRange}{products__range:url_title}{/stash:itemRange}
{exp:stash:append_list:nested name="searchResults--{products__range:url_title}" parse_tags="yes" trim="yes"}
{stash:productTitle}sdfds{/stash:productTitle}
{/exp:stash:append_list:nested}
{/exp:low_search:results}
{/exp:stash:set_list:searchRanges}
{/exp:stash:set}
{!-- Fetch the data --}
{exp:stash:get_list name="searchRanges" unique="itemRange"}
<p>{itemRange} - This is being returned.</p>
{!-- Adding process="end" to this makes it return the correct amount, but adding process="end" to the nested get_list still returns nothing --}
{exp:stash:list_count name="searchResults--{itemRange}" process="end"}
{exp:stash:get_list:nested name="searchResults--{itemRange}"}
<p>This content isn't being returned</p>
{/exp:stash:get_list:nested}
{/exp:stash:get_list}
Edit
Looking at the template debugger, I can see the get_list is parsing the name="searchResults--{itemRange}"
correctly, but I can't see the list being set anywhere, so looks like an it's an issue with the nested list not being set. I've tried adding process="end" to the nested append_list but nothing still
{/exp:stash:append_list:nested}
.