Getting all search result via Javascript

New Member
13 0 0

Are there any way I can retrieve all shopify result.search via Javascript so I can make my own pagination for it, as I really want to hide all out of stock products but it leaves uneven grids and sometimes a whole blank page as they sometimes sells product that are only 1 piece so they have tons of product that are sold out but doesnt want to remove or hide them.  So im thinking if there is away I can retrieve all results.

0 Likes
Shopify Partner
246 9 49

You can get 1000 results with ajax and then do what you want with it using javascript. You use an 'alternative' search template which you request by ajax and then inject into the page.

 

0 Likes
New Member
13 0 0
Hi thank you! but I am not sure why I cannot see this ajax documents as all I can find is the shopify's cart ajax which I always use.
0 Likes
Highlighted
Shopify Partner
246 9 49

You gotta know how to program javascript and refer to methods for doing ajax calls. It's not shopify specific. The only shopify part is you have to set up a search.alternate template that can return/output the data you want to use.

0 Likes