Click one of the categories. Often times, it will show some seats when I click Tables, or some tables when I click Lighting.
Set up, On page load:
Set Custom States by extracting data from page URL
Pass the Custom States Text to Algolia
Algolia passes back Unique IDs of products
RG references UIDs for which products to show
It seems to be loading the RG before the Custom States are complete, since when I use debug_mode and run ‘step by step’ the products will load in the RG incorrectly initially until I pass by the step to apply the Custom States, at which point the correct products are shown.
Is there a way to stop the RG loading so quickly, to speed up the Custom State on Page Load or only load RG after Custom States are set.
You can query Algolia directly from the url parameter to avoid being delayed by custom states being set.
– Didn’t know you could do this. Will investigate.
Can the custom states be of type text that represents the options’ values?
– Actually already did this (custom states as text) I incorrectly called it Option Sets. I’ve corrected my initial post.
Where is the user being redirected from in order to arrive here with the OS filters? Is the RG count high? If it helps and is feasible, you can send the actual UIDs in the URL parameters.
– Either this current page (it reloads if they click a filter) or another part of the site.
No but you can put a conditional on the RG to only be displayed when AlgoliaSimpleSearch Products != " " or alternatively, a separate custom state of whether to show results that is only set after all the other custom states in the CE i mentioned above.
Seems like some heavy filtering client side which can be a big performance drag. Every time user changes a filter on this page it refreshes URL parameters and the page?!?