Form with auto-suggest redirect if collection exists

Form with auto-suggest redirect if collection exists

Gunny
New Member
6 0 0

Hi all!

 

I'm setting up a store that supplies ready made and custom cushions. The ready made cushions are organized in collections by make and model of vehicle. I would like to create a form for customers to fill out with drop downs for make and model of vehicle. It would be great to populate these drop down based on the collections that exist in the store so that I don't have to remember to update the form when new collections are added.

 

Also, if the collection doesn't exist( because I don't carry that make and model in stock), I would like to redirect the customer to a form to enter dimensions so that a custom cushion can be quoted.

 

I'm experienced with html, javascript, ajax, etc. and I've looked over the liquid docs. Is there an example to refer to to cut down on the trial and error and get me to minimum viable product quickly? I can iteratively refine from there...

 

I found the Ajax API but there isn't an easy way to query all collections.

The myshopify.com/search/suggest.json?   REST API only returns products. It doesn't get me collections information.

 

The Storefront GraphQL arguments

{
"query": "query { collections(first: 250) { edges { node { title } } } }"
}

 

Limits the returns to 250. I'd like an argument that returns all!

 

Thanks in advance for any assistance you may be able to lend.

 

Replies 0 (0)